I'm using xamdatagrid and customized its RecordSelector by having checkbox. This is ok. But my problem now is, how can I get those checked/selected rows? I will greatly appreciate your reply. My pleasure to get supported with this one.
Thank you.
Hi Josh,
I have applied this style and found that the record pin icon is not visible. Is there a way to have the record pin icon intact with the checkbox style applied??
Sreeram.
Hi,
I blogged a way to do this:
http://blogs.infragistics.com/blogs/joshs/archive/2008/09/04/adding-checkboxes-to-the-record-selectors-in-xamdatagrid.aspx
Josh
The best way to do it is to have a property on your data objects to which the IsChecked property of the CheckBox can be bound. This is preferred because otherwise you will need to write code that inspects the element tree of the XamDataGrid, and that can be non-trivial. Failing that, you could bind the IsChecked property to a RelativeSource where the AncestorType is DataRecordPresenter, and the Path is DataRecord.Tag, and you'd need a value converter to convert null to false. The problem with this approach, however, is that you must walk over the DataRecords to find the Tag of each record. That is easy, until the user starts grouping the records, in which case you now must walk down the record hierarchy to find the DataRecords.