I have a button that when the user clicks it will save the data from RadSpreadsheet into a DataTable. I need to know how to loop through only the rows of the worksheet that are visible. For example, the user starts with 200 rows and applies a data filter to get it down to only 20 rows.
private Boolean IsRowVisible(int row, int colCount, Worksheet ws)
{
Boolean retValue = true;
for (int col = 0; col < colCount; col++)
{
IFilter filter = ws.Filter.GetFilter(col);
if (filter != null)
{
CellSelection objSelection = ws.Cells[row, col];
if (!filter.ShouldShowValue(objSelection.GetValue().Value))
{
retValue = false;
}
}
}
return retValue;
}
0
Anna
Telerik team
answered on 08 Oct 2014, 10:09 AM
Hi Allen,
I would just like to confirm that your solution is what I would recommend as well. It follows correctly the logic the filtering feature uses to hide the necessary rows.
On a side note, while the hidden rows and columns feature is still not available, there is an item logged for it in our feedback portal, where its progress can be tracked.
Regards,
Anna
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.