DataGrid - CheckBox selection from Code.
-
Hi Developer, I am using one select All Button to select all row in Datgrid (CheckBox selection). So how to Check CheckBox in Datagrid. Regards Nanda.
In the collection that you are binding to, you have a collection of items. Each item is an instance of an object that represents a single row. Add a property to this that represents whether or not it has been checked, make it raise the PropertyChanged event and bind your Checked to this. Finally, when the user clicks select all, simply iterate over the collection and set the checked property to true. With the wonder of data binding, the UI will also update.
Forgive your enemies - it messes with their heads
My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility