The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
What is the best way to remove a range of selected rows from a non bound grid. I tried to use the following but list.Count returns 0 after the first row is removed.
GridRangeInfoList list; while (true) { list = grid.Selections.GetSelectedRows(true, false); if (list.Count == 0) break;
GridRangeInfo range = list[0]; int row = range.Top;
Let me add to this; this only happens when the selected rows are not contiguous! If the rows are contiguous then it works fine.
>What is the best way to remove a range of selected rows from a non bound grid. I tried to use the following but list.Count returns 0 after the first row is removed.
GridRangeInfoList list; while (true) { list = grid.Selections.GetSelectedRows(true, false); if (list.Count == 0) break;
GridRangeInfo range = list[0]; int row = range.Top;
grid.Model.Rows.RemoveRange(row,row ); }
HAhaneefm Syncfusion Team January 4, 2008 08:07 PM UTC
Hi Joe,
Please try these code snippet to remove the selected rows in a grid.
GridRangeInfoList list; list = gridControl1.Selections.GetSelectedRows(true, false);
for(int i = list.Count -1 ;i>=0;i--) { GridRangeInfo range = list[i]; this.gridControl1.Model.Rows.RemoveRange(range.Top, range.Bottom); }