1.Its helps you for,how to bind data in datagrid in wpf,
http://www.codeproject.com/Articles/30905/WPF-DataGrid-Practical-Examples
For 2nd one;
WPF doesn't know how to deal with your checkedBoxIte items. I suggest you to change your class as follows:
public class checkedBoxIte
{
public string MyString {get;set;}
public bool MyBool { get; set; }
}
And then to set the columns of your DataGrid in this way:
<DataGrid AutoGenerateColumns="False">
<DataGrid.Columns>
<DataGridTextColumn Header="MyString" Binding="{Binding MyString}" />
<DataGridCheckBoxColumn Header="MyBool" Binding="{Binding MyBool}" />
</DataGrid.Columns>
</DataGrid>
Now you can set the ItemsSource:
for (int i = 0; i < 5; i++)
{
checkedBoxIte ite = new checkedBoxIte();
ite.MyString = i.ToString();
item.Add(ite);
}
dataGrid1.ItemsSource = item;
Premalatha
Software Engineer
Savari_Arm, if this helps please login to Mark As Answer. | Alert Moderator