I set a CheckBox as template column in XamGrid like:
<ig:TemplateColumn Key="MyColumn"> <ig:TemplateColumn.HeaderTemplate> <DataTemplate> <TextBlock Text="{MyColumn}"/> </DataTemplate> </ig:TemplateColumn.HeaderTemplate> <ig:TemplateColumn.ItemTemplate> <DataTemplate> <CheckBox IsChecked="{Binding MyColumn, Mode=TwoWay}" Checked="CheckBox_Checked" /> </DataTemplate> </ig:TemplateColumn.ItemTemplate> </ig:TemplateColumn>
then in code for event handler CheckBox_Checked, I want to get the row data of the current row when user click on the CheckBox. How can I do it?
Hello benjaminswitzer,
Also you can get the whole XamGrid row from the Clicked event as follows:
private void CheckBox_Checked(object sender, RoutedEventArgs e)
{
((sender as CheckBox).Parent as CellControl).Cell.Row.ToString();
}
If you need any additional assistance on this matter please let me know.
Thank you. then how to get all rows of the XamGrid?
You can try to iterate through all of the rows in the xamGrid1.Rows collection.
If you have any additional questions on this matter or if I have misunderstood you in any way please let me know.