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

SfDataGrid NumericColumn How and when to get value after value is edited?

Hi,

was wondering how to get the value of a numeric cell after the user has edited the cell and changed the value. In what event should this retrieval be tasked?

When i use the CurrentCellEndEdit event, the GetCellValue shows the value from the Binding Model (previous value), but I can see thew new value in the renderer -> currentCellRendererElement object.

Could you please advise on the best way to achieve this please.

Thanks in advance,
Richy

3 Replies

AN Ashok N Syncfusion Team June 9, 2017 09:47 AM UTC

Hi Richy, 
 
Thanks for contacting Syncfusion support.  
 
You can achieve your requirement by handling same CurrentCellEndEdit and SfDataGrid.GetCellValue method with help of asyn and await. Because it will take some time for notify the property changed in view while change the new value. Please refer the below code example: 
 
private async void DataGrid_CurrentCellEndEdit(object sender, GridCurrentCellEndEditEventArgs args) 
{ 
    await Task.Delay(100); 
    var newCellValue = dataGrid.GetCellValue(viewModel.OrdersInfo[args.RowColumnIndex.RowIndex - 1], dataGrid.Columns[args.RowColumnIndex.ColumnIndex].MappingName); 
} 
 
Regards, 
Ashok 



RH Richard Hadlow June 9, 2017 01:09 PM UTC

Hi Ashok,

that did the trick. Thanks

Richy



AN Ashok N Syncfusion Team June 12, 2017 10:30 AM UTC

Hi Richy, 
 
Thanks for your update. Please let us know if you require further assistance on this. 
 
Regards, 
Ashok 


Loader.
Up arrow icon