The image explains by itself. My checkbox is loaded as a LabelPresenterStyle. I want to apply IsChecked property to ChildRecords.
Hello Ronald,
You can use the AttachedToRecord property of HeaderRecord, it will return the DataRecord that this header is attached to. This way you can access the GroupByRecord and by using it's ViewableChildRecords method you can access the records you wish, for example:
private void CheckBox_Checked(object sender, RoutedEventArgs e) { var drp = Utilities.GetAncestorFromType((sender as CheckBox) as DependencyObject, typeof(DataRecordPresenter), true) as DataRecordPresenter; if (null != drp) { var groupByRec = ((drp.DataRecord as DataRecord) as HeaderRecord).AttachedToRecord.ParentRecord as GroupByRecord; if (null != groupByRec) { foreach (var rec in groupByRec.ViewableChildRecords) { var dataItem = (rec as DataRecord).DataItem as Product; } } } }
I have attached a simple project, which you can use to test this approach.
Let me know if you have any questions.
Sincerely,ZhivkoAssociate Software Developer
Thanks, worked perfectly