We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Handling the checkbox check event

Thread ID:

Created:

Updated:

Platform:

Replies:

114065 Oct 25,2013 01:31 PM UTC Nov 25,2013 12:56 PM UTC WPF 2
loading
Tags: GridControl
Brent Hoskisson
Asked On October 25, 2013 01:31 PM UTC

I have a checkbox in a GridDataControl column.  How can I handle when the checkbox gets checked or not?


Brent Hoskisson
Replied On October 25, 2013 05:55 PM UTC

I found the GridDataControl.CurrentCellChanged event, but now how do I get the new value of the cell?  It doesn't seem to make updates to the underlying model.

 


Kasthuriraja G [Syncfusion]
Replied On November 25, 2013 12:56 PM UTC

Hi Brent,

We have analyzed your Query.

You can achieve your requirement by using ControlValue.This ControlValue holds the Newly Updated Value.

You can refer the below Code Snippet  to achieve your requirement.

Code snippet [C#]:

 

this.SyncGrid.CurrentCellChanged += new Syncfusion.Windows.ComponentModel.

GridRoutedEventHandler(SyncGrid_CurrentCellChanged); 

 

void SyncGrid_CurrentCellChanged(object sender, Syncfusion.Windows.ComponentModel.

SyncfusionRoutedEventArgs args)

        {

             var currentcellmanager = this.SyncGrid.Model.CurrencyManager;

             if (currentcellmanager.CurrentCell.HasCurrentCell)

            {

                var currentcell = currentcellmanager.CurrentCell;

                 if (currentcell.Renderer is GridCellCheckboxRenderer)

                {

                      var value = currentcell.Renderer.ControlValue as bool?;

                      if ((bool)value)

                    {

                        MessageBox.Show("CHECKED");

                    }

                        else

                    {

                        MessageBox.Show("UNCHECKED");

                    }

 

                }

 

            }

 

We have prepared a sample based on this and you can find the sample under the following location:

Sample : checkboxevent.zip

Please let us know if this helps.

Thanks/Regards,

Kasthuriraja.G


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;