datagrid checkbox click event

Jan 22, 2009 at 2:19 PM
Hi

I have a datagrid bound to a datatable, that contains rows with some boolean values

I have a handler named "dgDataCheck_Checked" for the check event for every checkbox in my datagrid  like in the xaml below.

I found that this event is fired
1) when I manually click on one checkbox
2) when the datagrid is loaded / bound to the data

How can I distinguish these two call sources?

I succeded to set a flag using BeginningEdit and CellEndingEdit events, but I am asking myself if this is the best to do?

Here is the xaml
      <dg:DataGrid x:Name="dgData"
                   CanUserAddRows="False"
                   CanUserSortColumns="False"
                   AutoGenerateColumns="True"
                   IsSynchronizedWithCurrentItem="False"
                   FrozenColumnCount="1"
                   SelectionUnit="Cell"
                   MouseRightButtonUp="dgData_MouseRightButtonUp"
                   CheckBox.Checked="dgDataCheck_Checked"


Regards
Klaus