I have a data grid which is bounded to a simple List.
now i want to add a checkbox column to it that when iterating threw the items of the grid i will be able to add to another list only the rows where the chckbox is selected.
is it possible?
many thanks
You sure can. First I would recommend that your List be an ObservableCollection so that the DataGrid stays bound.
First Create the DataGrid in XAML
(SampleOne, SapleTwo, and SampleThreeCheckBox are all properties in your object that’s in your list.)
Second update your Code-Behind
Set the DataContext to this or your ViewModel
Then create a new list with only the check ones and set that to your ItemSource of the new DataGrid.