Home Forums WinForms controls Xceed Grid for WinForms How to return filtered grid rows only? Reply To: How to return filtered grid rows only?

User (Old forums)
Member
Post count: 23064

Maybe you could use a function like this:<pre>ArrayList GetFilteredDataRows(GridControl grid) {
ArrayList filteredRows = new ArrayList();
foreach(Xceed.Grid.DataRow row in grid.GetSortedDataRows(true))
if (row.Visible) filteredRows.Add(row);
return filteredRows;
}</pre>Or in .NET 2.0:<pre>IList<Xceed.Grid.DataRow> GetFilteredDataRows(GridControl grid) {
List<Xceed.Grid.DataRow> filteredRows = new List<Xceed.Grid.DataRow>();
foreach(Xceed.Grid.DataRow row in grid.GetSortedDataRows(true))
if (row.Visible) filteredRows.Add(row);
return filteredRows;
}</pre>

Imported from legacy forums. Posted by Tommy (had 381 views)