tags:

views:

177

answers:

2

Hey guys,

I have wpf datagrid, in one of columns, I checkboxes added in it, now the problem is how do I get "IsChecked" propoerties of it ?

Note: I have not bind that column to any datacontext, and its a Template Column

Thanks

A: 

You need to either

  1. Record those checkboxes using variables or identifiers in XAML. Or,
  2. Iterate over the children of the grid looking for the checkboxes using some recognition function (a predicate).
Frank Krueger
+1  A: 

It depends on how you use the DataGrid. In a proper MVVM pattern of databinding, you might have already bind a bool property of a class to the checkbox and whenever the checkbox changes its value you will get the property change notification in your ViewModel class.

Jobi Joy