We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Selected Records on GridGroupingControl

Is there an easy way to get the selected records while using a filterbar in the gridGroupingControl.

I tried:
List intList = new List();

//Get the selected rows from the groupin grid.
GridRangeInfoList range = this.gridGroupingControl1.TableModel.Selections.GetSelectedRows(true, true);
range = range.Expand(1, 1, grid.RowCount, grid.ColCount);
foreach (GridRangeInfo info in range)
{
if (info.IsRows)
{
for (int i = info.Top; i <= info.Bottom; i++)
{
if (i - 3 >= 0)
intList.Add(i - 3);
}
}
}

return intList.ToArray();

This properly return the index of the record if it has been filtered but then if i use that index on the Table.Records which is unfilterd and it selects the wrong one.

is there a way to access the filtered collection or have this return the unfiltered indexes?


1 Reply

HA haneefm Syncfusion Team July 17, 2007 11:24 PM UTC

Hi,

Is there an easy way to get the selected records while using a filterbar in the gridGroupingControl.
>>>>>>>>>>>>>>>>>
Yes, you can get the selected records collection from the GridTable property. Below is a code.

foreach(SelectedRecord rec in this.grid.TableModel.Table.SelectedRecords)
{
Console.WriteLine(rec.Record);
}

Is there a way to access the filtered collection or have this return the unfiltered indexes?
>>>>>>>>>>>>>>>>>
You can try these code:

foreach(Record rec in this.grid.TableModel.Table.FilteredRecords)
{
Console.WriteLine(rec);
}

Best regards,
Haneef

Loader.
Live Chat Icon For mobile
Up arrow icon