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.

Handling the checkbox check event

Thread ID:

Created:

Updated:

Platform:

Replies:

114065 Oct 25,2013 09:31 AM Nov 25,2013 07:56 AM WPF 2
loading
Tags: GridControl
Brent Hoskisson
Asked On October 25, 2013 09:31 AM

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 01:55 PM

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 07:56 AM

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.

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.

;