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'm having trouble using the GetNextCell in a virtual grid when selecting rows. It seems, no matter how many columns I actually have, GetNextCell keeps returning columns which don't exist. Is there something wrong with the following code?
ArrayList rows = new ArrayList();
GridRangeInfoList selectedRows =
this.gridControl1.Selections.GetSelectedRows(false, true);
foreach (GridRangeInfo info in selectedRows )
{
int top;
int left;
if ( info.GetFirstCell(out top, out left) )
{
do
{
if ( !rows.Contains(top) )
{
rows.Add(top);
}
} while( info.GetNextCell( ref top, ref left ));
}
}
Thanks,
Sue
ADAdministrator Syncfusion Team October 6, 2003 10:08 PM UTC
The call to GetSelectedRows will return ranges of type GridRangeType.Row. The GetNextCell type works only with GridRangeType.Cell. What you should do is before the call to
if ( info.GetFirstCell ...
you should call
info.ExpandRange(1, 1, RowCount, ColCount);
This will convert the Row range into a Cell range that you can loop through.
Stefan