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.
I have a remove button on a form that lets the user remove multiple selections of rows. What would be the best way to do this. I have tried GridRangeInfoList r = gridControl1.Selections.GetSelectedRows(true, true); this gets me the range but I can't seem to get the index (int) of the rows. Please tell me what is the best way of removing multiple selections of rows.
> I have a remove button on a form that lets the user remove multiple selections of rows. What would be the best way to do this. I have tried GridRangeInfoList r = gridControl1.Selections.GetSelectedRows(true, true); this gets me the range but I can't seem to get the index (int) of the rows. Please tell me what is the best way of removing multiple selections of rows.
> I answered my own question. Here is what I did for those that are interested.
foreach(GridRangeInfo r in gridControl1.Selections.GetSelectedRows(true,true))
{
gridControl1.Rows.RemoveRange(r.Top, r.Bottom);
}
the r.top and r.bottom did not do what I though they did.
ADAdministrator Syncfusion Team September 23, 2003 08:37 PM UTC
Try to reverse looping throw the ranges, e.g.
GridRangeInfoList ranges = gridControl1.Selections.GetSelectedRows(true,true);
for (int n = ranges.Count-1; n>= 0; n--)
gridControl1.Rows.RemoveRange(ranges[n].Top, ranges[n].Bottom);
Stefan