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

Retrieve values from CurrentCellChanged event

Thread ID:

Created:

Updated:

Platform:

Replies:

104691 Aug 9,2012 06:30 AM Aug 9,2012 07:09 AM Windows Forms 1
loading
Tags: GridControl
Kingsly Joseph
Asked On August 9, 2012 06:30 AM

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.

Ragamathulla B [Syncfusion]
Replied On August 9, 2012 07:09 AM

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.


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

;