I have a Gridview, for displaying customer payment data. By default, I alter the display of any rows containing past due customers, using some checks that are only easily available in the RowDataBound event. I would like to add the option to filter out the data to only show rows which are or are not past due, based on an input. What is the best way to do this?
I'm thinking something along the lines of:
protected void gvTenantList_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (null != e.Row.DataItem)
{
DataRowView rowView = (DataRowView)e.Row.DataItem;
if (hsPastDueLeases.Contains((int)rowView["LeaseID"]))
{
e.Row.CssClass += " pinkbg";
if (showCurrentOnly) //code to prevent showing this row
}
else if (showPastDueOnly) //code to prevent showing this row
}
}
Basically, I need to know what belongs in the //code to prevent showing this row