Get number of rows after applying the filter on GridWeb

Thank you for the “Count of Rows” feature. Can I call the code(for loop) in GridWeb1_ColumnFilter(sender As Object, e As Aspose.Cells.GridWeb.RowColumnEventArgs) event, so I can get the number of rows as soon as the filter has been chosen? If not in which event should I call so that when a filter I chosen and I can display the number of rows.



Thanks

Hi Trevor,


Thank you for contacting Aspose support.

First of all, please note that we have split the existing thread to create a new on your behalf because it is advised to create a new thread for every distinct inquiry while providing appropriate thread titles.

Regarding your original concerns, I am afraid, the current set of Aspose.Cells.GridWeb component does not offer any means to retrieve the number of rows after applying the column filter on GridWeb interface. This is because, the component currently offers the OnBeforeColumnFilter event whereas you require the OnAfterColumnFilter event to achieve your requirement. If you confirm, we can log this requirement as a feature request and consider providing the similar event with future releases of Aspose.Cells.GridWeb component.

The signature of aforementioned event should look as follow.

public event RowColumnEventHandler OnAfterColumnFilter

Yes please, I want this feature.
public event RowColumnEventHandler OnAfterColumnFilter

Thank you
Jaisree

Hi Jaisree,


Thank you for the confirmation. I have logged a feature request with Id CELLSNET-44313 in our database for feasibility analysis. As soon as we completed the analysis, we will share the estimated release schedule here for you reference.

Hi,


This is to inform you that we have fixed your issue logged earlier as “CELLSNET-44313”. We will soon share the Download link for the supported version/release after performing QA and incorporating other enhancements and fixes.

Thank you.

The issues you have found earlier (filed as CELLSNET-44313) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.

Hi Jaisree,


Please check the following piece of code to get the number of hidden & visible rows after applying the column filter from the Aspose.Cells.GridWeb interface. Please also check the article on newly added AfterColumnFilter event.

C#

protected void GridWeb1_AfterColumnFilter(object sender, Aspose.Cells.GridWeb.RowColumnEventArgs e)
{
string hidden = “”;
int headrow = 0;
int maxrow = GridWeb1.WorkSheets[0].Cells.MaxRow;
int count = 0;
for (int i = headrow + 1; i <= maxrow; i++)
{
if (GridWeb1.WorkSheets[0].Cells.Rows[i].Hidden)
{
hidden += “-” + (i + 1);
}
else
{
count++;
}
}
//Count of hidden and visible rows after the applying filter on any column
string result = "[Hidden Rows]: " + hidden + " [Visible Rows]: " + count;
}