Articles in this section

How to get the edited records in WinForms DataGrid?

In WinForms DataGrid (SfDataGrid), edited records can be retrieved in the CurrentCellValidated event. This event is triggered once cell validation is completed with valid data, allowing access to both the edited cell value and the corresponding row values.

//Event subscription
sfDataGrid1.CurrentCellValidated += OnCurrentCellValidated;

//Event customization
private void OnCurrentCellValidated(object sender, CurrentCellValidatedEventArgs e)
{
    if(e.NewValue != null)
    {
        editedRecords.Add(e.NewValue);
    }
    
    if(e.RowData != null)
    {
        editedRows.Add(e.RowData as OrderInfo);
    }
} 

Take a moment to peruse the WinForms DataGrid - CurrentCellValidated event documentation, where you can find about the cell validation with code examples.

View sample in GitHub

Conclusion

I hope you enjoyed learning how to get the edited records in WinForms DataGrid.

You can refer to our WinForms DataGrid feature tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started with configuration specifications. You can also explore our WinForms DataGrid example to understand how to create and manipulate data.
For current customers, check out our components from the License and Downloads page. If you are new to Syncfusion, try our 30-day free trial to check out our other controls.
Please let us know in the comments section if you have any queries or require clarification. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Access denied
Access denied