Hi,
I am using XamDataGrid in which i want to get the whole Data present in the records which are selected.Is there any event which fires when we multi select the XamDataGrid and how can we get the hold of Data of the selected records....please let me know whether we can handle this or not...Thanks
The event that would fire is the SelectedChanging/SelectedItemChanged. In the Chaging event, you will have direct access to the new selection, but you can also check the SelectedItems.Records collection (if you want to get the selected records only).
This collection contains objects of type Record. You can cast this to DataRecord and you will have access to the Cells - through the cells collection or directly to the underlying data object - through the DataItem property.
Hope this helps
although i select multiple records , the XamDataGrid.SelectedItems.Records.Count is zero,i am not able to get the all selected records.
I do not see how this is possible. Have you set the SelectionTypeRecord? If the problem still exists, please attach a sample that reproduces this problem and we will look into it.
This because records are only selected when user clicks on the record selector (the small triangle to the left of the row). If you select on the row, the cell directly below the mouse is selected.
yes i have set SelectionTypeRecord="Extended", but the XamDataGrid.SelectedItems.Records.Count=0 inspite of multiple Selection.
I have tried with the below Code which worked
foreach(Infragistics.Windows.DataPresenter.Cell myCell in XamDataGrid.SelectedItems.Cells)
{
// i was able to get the records Collection here with myCell .Record.DataItem
}