Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
144649 | May 15,2019 05:11 PM UTC | May 16,2019 10:44 AM UTC | WinForms | 1 |
![]() |
Tags: SfDataGrid |
// Add the below code in constructor or form loading
this.sfDataGrid.AllowDeleting = true;
this.sfDataGrid.Columns.Add(new GridButtonColumn()
{
MappingName = "Quantity",
HeaderText = "Remove",
AllowDefaultButtonText = true,
DefaultButtonText = "Remove this row"
});
this.sfDataGrid.CellButtonClick += sfDataGrid_CellButtonClick;
void sfDataGrid_CellButtonClick(object sender, Syncfusion.WinForms.DataGrid.Events.CellButtonClickEventArgs e)
{
int _Dgdeletingrowindex = sfDataGrid.TableControl.ResolveToRecordIndex(sfDataGrid.CurrentCell.RowIndex);
// Delete record by based on the row index
sfDataGrid.View.RemoveAt(_Dgdeletingrowindex);
// Or you can call the below code the delete the selected record
// this.sfDataGrid.DeleteSelectedRecords();
}
|
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.
This page will automatically be redirected to the sign-in page in 10 seconds.