Is there a way to fire an event everytime a checkbox is checked or unchecked?
Thanks
What is the recommended practice for doing this in 12.2, where template columns have both an item template and a editing template for check box columns?
Hi Krasimir,
I'm suprised that IG didnt build in a CheckChanged event into the checkbox column. Thank you for providing sample code. I'm having an issue with it as everytime i edit a checkbox, then click out of the row, the xamGrid1_CellControlAttached event fires again and adds another event handler onto the cell's checkbox which cuases the checked events to fire many times each time the check the cell. For my situation, creating a template column is not desired. are there any other solutions for this? I would think many people would be in need.
Thank you.
Hello,
I am just checking if you require any further assistance on the matter.
Sincerely,
Krasimir
Developer Support Engineer
Infragistics
www.infragistics.com/support
Another approach that you can use is to use a TemplateColumn instead and to add a CheckBox in its ItemTemplate. After doing so you will be able to handle the Checked and Unchecked events of the CheckBox. Here is an example for adding a TemplateColumn with an CheckBox in its ItemTemplate:
<ig:XamGrid.Columns> <ig:TemplateColumn Key="IsChecked1"> <ig:TemplateColumn.ItemTemplate> <DataTemplate> <CheckBox IsChecked="{Binding IsChecked1}" Checked="CheckBox_Checked" Unchecked="CheckBox_Unchecked"/> </DataTemplate> </ig:TemplateColumn.ItemTemplate> </ig:TemplateColumn>
If you have any further questions please do not hesitate to ask.
I have been looking into the functionality that you are looking for and I can suggest handling the CellControlAttached event of the XamGrid and in its event handler you can get the CheckBox which is in the currently attached CellControl and handle its Checked and Unchecked events. I have created a sample application which demonstrates how this approach can be achieved.