Hello,
I am using a RadGrid with filtering capability on multiple columns and have run into an issue. Background: the users want the grid to default to only items that were created in the current fiscal year. I have already applied the initial filter in the NeedDataSource event as follows:
ASPX:
<telerik:GridDateTimeColumn DataField="Created" HeaderText="Submitted Date" SortExpression="Created" DataFormatString="{0:d}"
FilterControlWidth="120px" UniqueName="Created" PickerType="DatePicker" EnableRangeFiltering="true">
<HeaderStyle Width="150px" />
</telerik:GridDateTimeColumn>
ASPX.CS (in NeedDataSource function after grid DataSource is set)
if (!Page.IsPostBack)
{
RadGrid1.MasterTableView.FilterExpression = string.Format("([Created] >= \'{0:d}\') AND ([Created] <= \'{1:d}\')", FiscalYearStart, FiscalYearEnd);
GridColumn createdDate = rgRevenueAdjustments.MasterTableView.GetColumnSafe("Created");
createdDate.CurrentFilterFunction = GridKnownFunction.Between;
createdDate.CurrentFilterValue = FiscalYearStart.ToShortDateString();
createdDate.AndCurrentFilterValue = FiscalYearEnd.ToShortDateString();
}
This all works fine, with the exception that the filter values do not appear in the RadDatePickers, as shown below:
![]()
The main issue I'm trying to solve is that when a user filters on another column, the filter for this column is removed, where I want it to filter down the existing items. I've tried to do some searching around to solve this, and haven't really found any answers yet. Am I missing something?
As a side note: I would really love for the RadDatePickers to appear on two lines rather than expanding out horizontally. Is this possible?
I am using a RadGrid with filtering capability on multiple columns and have run into an issue. Background: the users want the grid to default to only items that were created in the current fiscal year. I have already applied the initial filter in the NeedDataSource event as follows:
ASPX:
<telerik:GridDateTimeColumn DataField="Created" HeaderText="Submitted Date" SortExpression="Created" DataFormatString="{0:d}"
FilterControlWidth="120px" UniqueName="Created" PickerType="DatePicker" EnableRangeFiltering="true">
<HeaderStyle Width="150px" />
</telerik:GridDateTimeColumn>
ASPX.CS (in NeedDataSource function after grid DataSource is set)
if (!Page.IsPostBack)
{
RadGrid1.MasterTableView.FilterExpression = string.Format("([Created] >= \'{0:d}\') AND ([Created] <= \'{1:d}\')", FiscalYearStart, FiscalYearEnd);
GridColumn createdDate = rgRevenueAdjustments.MasterTableView.GetColumnSafe("Created");
createdDate.CurrentFilterFunction = GridKnownFunction.Between;
createdDate.CurrentFilterValue = FiscalYearStart.ToShortDateString();
createdDate.AndCurrentFilterValue = FiscalYearEnd.ToShortDateString();
}
This all works fine, with the exception that the filter values do not appear in the RadDatePickers, as shown below:
The main issue I'm trying to solve is that when a user filters on another column, the filter for this column is removed, where I want it to filter down the existing items. I've tried to do some searching around to solve this, and haven't really found any answers yet. Am I missing something?
As a side note: I would really love for the RadDatePickers to appear on two lines rather than expanding out horizontally. Is this possible?