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. Image for the cookie policy date

Retrieve values from CurrentCellChanged event

Hi, 

I am using a syncfusion grid in my Form. I have multiple updown controls inside my grid. I need to track the values as it changes in the grid. For that I had registered for the CurrentCellChanged event of the grid control. My problem is that I was not able to get the updated value of the cell. For example if i change the value from 1 to 2 unless i lost focus on the cell the value retrieved from the cell is 1.

I am using the grid Text property to retrieve the value. I am not sure how will i get the latest value changed in the grid. If anyone have any idea, please help.

What should i use instead of Grid.Text to get the updated value? Thank you for your help in Advance.

1 Reply

RB Ragamathulla B Syncfusion Team August 9, 2012 11:09 AM UTC

Hi Kingsly,

Thank you for your interest in Syncfusion products.

Query

Need to get updated value

You can get the updated value by using AcceptedChanges event. Please refer to the following code.

this.gridControl1.CurrentCellAcceptedChanges += new CancelEventHandler(gridControl1_CurrentCellAcceptedChanges);

 

            this.gridControl1.CurrentCellDeactivated += new GridCurrentCellDeactivatedEventHandler(gridControl1_CurrentCellDeactivated);

 

            this.gridControl1.CurrentCellValidating += new CancelEventHandler(gridControl1_CurrentCellValidating);

 

//way1

        void gridControl1_CurrentCellAcceptedChanges(object sender, CancelEventArgs e)

        {

 

        }

        //way 2

        void gridControl1_CurrentCellValidating(object sender, CancelEventArgs e)

        {

 

        }

        //way 3

        void gridControl1_CurrentCellDeactivated(object sender, GridCurrentCellDeactivatedEventArgs e)

        {

           

        }

//Occurs before the current cell switches into editing mode

this.gridControl1.CurrentCellStartEditing += new CancelEventHandler(gridControl1_CurrentCellStartEditing);

//Occurs when the grid completes editing mode, i.e., when the active current cell exits the editing mode

this.gridControl1.CurrentCellEditingComplete += new EventHandler(gridControl1_CurrentCellEditingComplete);

//Occurs when the grid accepts changes made to the active current cell

this.gridControl1.CurrentCellAcceptedChanges += new CancelEventHandler(gridControl1_CurrentCellAcceptedChanges);

Hope this will be helpful for your references.

http://help.syncfusion.com/UG/User%20Interface/Windows%20Forms/Grid/Documents/42217events1.htm

http://help.syncfusion.com/UG/User%20Interface/Windows%20Forms/Grid/Documents/434133currentcellevents.htm

 

http://help.syncfusion.com/UG/User%20Interface/Windows%20Forms/Grid/Documents/5334howtovalidatechangesmadetoagridcell.htm

Please refer to the following sample which illustrates the same.

http://www.syncfusion.com/downloads/Support/DirectTrac/97288/CS-1717570285.zip

Let me know if you have any further concerns.

Regards,

Ragamathullah B.


Loader.
Live Chat Icon For mobile
Up arrow icon