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

Editing cell

Hi, I need to get the value of edited cell. Currently I use the event "CurrentCellEndEdit" and the property AllowEditing="True" but I don't know how to get the value of edited field.

3 Replies

VP Vimal Prabhu Manohkaran Syncfusion Team March 10, 2017 09:49 AM UTC

Hi Andy,

Thanks for contacting Syncfusion support.

Please find the below code snippet to achieve your requirement.

 
dataGrid.CurrentCellEndEdit += DataGrid_CurrentCellEndEdit;

//current cell end edit Event Handler 
private void DataGrid_CurrentCellEndEdit(object sender, GridCurrentCellEndEditEventArgs args) 
{ 
    // Will be hit here before the values are committed to the collection. 
    // Will be hit once the editing focus is lost for that gridcell. 
    // Values will be committed into the underlying collection only after the execution of this event 
    if (dataGrid.Columns[args.RowColumnIndex.ColumnIndex] is GridTextColumn) 
    { 
        var editedValue = this.dataGrid.CellRenderers["TextView"].GetControlValue(); 
    } 
    else if (dataGrid.Columns[args.RowColumnIndex.ColumnIndex] is GridPickerColumn) 
    { 
        var editedValue = this.dataGrid.CellRenderers["Picker"].GetControlValue(); 
    } 
    else if (dataGrid.Columns[args.RowColumnIndex.ColumnIndex] is GridNumericColumn) 
    { 
        var editedValue = this.dataGrid.CellRenderers["Numeric"].GetControlValue(); 
    } 
    else if(dataGrid.Columns[args.RowColumnIndex.ColumnIndex] is GridDateTimeColumn) 
    { 
        var editedValue = this.dataGrid.CellRenderers["DateTime"].GetControlValue(); 
    } 
} 
 

However we have plans to provide the edited value in the event arguments which may be available in any of our upcoming releases.

Regards,
Vimal Prabhu
 



AL Andy Link March 10, 2017 08:42 PM UTC

Thanks you


VP Vimal Prabhu Manohkaran Syncfusion Team March 13, 2017 06:56 AM UTC

Hi Andy,

You are welcome. Please let me know if you may require any other assistance.

Regards,
Vimal Prabhu


Loader.
Up arrow icon