Hello!
I would like to seek guidance on how to best approach custom filters using date ranges with Start and End date values. On my grid, I only have one "Date" column that I would like to filter by 5 date ranges (I'm using a RadComboBox for the filter):
I can retrieve the correct dates using a RowFilter, as well as get the current filter value, but am not successful in displaying the filter results on the grid.
In my class GridBoundColumnWithComboBoxFiltering : GridBoundColumn, this is what I have:
private void list_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e)
{
GridFilteringItem filterItem = (GridFilteringItem)((RadComboBox)o).NamingContainer;
filterItem.FireCommandEvent("Filter", new Pair("Contains", this.UniqueName));
}
protected override string GetCurrentFilterValueFromControl(TableCell cell)
{
if (((RadComboBox)cell.Controls[0]).Text == "Show All")
return "";
else
{
return ((RadComboBox)cell.Controls[0]).Text;
}
}
Thanks for your help!
I would like to seek guidance on how to best approach custom filters using date ranges with Start and End date values. On my grid, I only have one "Date" column that I would like to filter by 5 date ranges (I'm using a RadComboBox for the filter):
- This Month
- Last Month
- Last 3 Months
- Last 6 Months
- Older than 6 Months
I can retrieve the correct dates using a RowFilter, as well as get the current filter value, but am not successful in displaying the filter results on the grid.
In my class GridBoundColumnWithComboBoxFiltering : GridBoundColumn, this is what I have:
private void list_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e)
{
GridFilteringItem filterItem = (GridFilteringItem)((RadComboBox)o).NamingContainer;
filterItem.FireCommandEvent("Filter", new Pair("Contains", this.UniqueName));
}
protected override string GetCurrentFilterValueFromControl(TableCell cell)
{
if (((RadComboBox)cell.Controls[0]).Text == "Show All")
return "";
else
{
return ((RadComboBox)cell.Controls[0]).Text;
}
}
Thanks for your help!