Following code is added on CurrentCellKeyPress event, Kindly giude me what i am doing wrong ??
private void sfDataGrid_CurrentCellKeyPress(object sender, Syncfusion.WinForms.DataGrid.Events.CurrentCellKeyPressEventArgs e)
{
if (sfDataGridEntry.CurrentCell.Column.MappingName == "dcBillAmt" && sfDataGridEntry.CurrentCell.Column is GridNumericColumn
&& sfDataGridEntry.CurrentCell.CellRenderer.CurrentCellRendererElement != null)
{
int recordIndex = sfDataGridEntry.TableControl.ResolveToRecordIndex(e.RowIndex);
object rowData = null;
if (sfDataGridEntry.IsAddNewRowIndex(e.RowIndex))
{
rowData = sfDataGridEntry.View.CurrentAddItem;
}
else if (sfDataGridEntry.GroupColumnDescriptions.Count > 0)
{
NodeEntry record = sfDataGridEntry.View.TopLevelGroup.DisplayElements[recordIndex];
if (!record.IsRecords)
{
return;
}
rowData = (record as RecordEntry).Data;
}
else
{
RecordEntry record = sfDataGridEntry.View.Records.GetRecord(recordIndex);
rowData = record.Data;
}
if (rowData != null)
{
ItemPropertiesProvider propertyAccessProvider = sfDataGridEntry.View.GetPropertyAccessProvider();
if (decimal.TryParse(sfDataGridEntry.CurrentCell.CellRenderer.CurrentCellRendererElement.Text, out decimal cellValue))
{
//Update the edited value to the record and refresh the summary.
propertyAccessProvider.SetValue(rowData, sfDataGridEntry.CurrentCell.Column.MappingName, cellValue);
sfDataGridEntry.TableControl.Refresh();
}
}
}
}