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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Force commit cells value

Thread ID:





116449 May 26,2014 04:26 PM UTC Jun 5,2014 10:42 AM UTC WPF 3
Tags: GridControl
Luca Cavicchioli
Asked On May 26, 2014 04:26 PM UTC

I'm using the GridControl to display and modify data, with no data bound.
Suppose I have a row with a textbox and a checkbox, if I write something in the textbox (or I check the checkbox)  and I move away from the edited cell (I change column or row), everything is fine and that value is set as CellValue, but if I stay on that cell after editing (no row/column change) the property CellValue results empty and not with the value typed/checked.
My users wants to:
1) write something in the text box, 
1b) eventually move on the checkbox cell and check the checkbox 
2) press a button outside the grid and use the value that they have set in the grid cells

Now, the last value set will be lost if they do not move away from the edited cell (in the example shown in the picture attached, after pressing the button, the value of the checkbox cell "Attivo" is not set).
Is there a way to achieve this behavior?
Thank you

Attachment: SS_b370bb2b.zip

Kanimozhi Bharathi [Syncfusion]
Replied On May 29, 2014 10:07 AM UTC

Hi Luca,


Thank you for using Syncfusion Products.


We have analyzed your query. You can get the value of the cell while it is in edit mode by using ControlValue of CurrentCell Renderer like in the following code snippet


Code Snippet:

void button1_Click(object sender, RoutedEventArgs e)


    if (gridControl.CurrentCell.IsEditing)


         var value = gridControl.CurrentCell.Renderer.ControlValue;




         var row = gridControl.CurrentCell.RowIndex;

         var col = gridControl.CurrentCell.ColumnIndex;

         var value = gridControl.Model[row, col].CellValue;





Please let us know if you need any further assistance.



Kanimozhi B

Luca Cavicchioli
Replied On May 29, 2014 03:33 PM UTC

Thank you for the answer. It works exactly as expected!
Another question, is it possible to achieve the same behavior with the GridDataControl? (I miss the CurrentCell in GridDataControl)
Thank you, regards

Kanimozhi Bharathi [Syncfusion]
Replied On June 5, 2014 10:42 AM UTC

Hi Luca,


Apologize for the delay.


You can get CurrentCell in GridDataControl from the CurrencyManager of Model like the below code snippet.



var cell = griddatacontrol.Model.CurrencyManager.CurrentCell


Please let us know if you need any further assistance.



Kanimozhi B


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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