I have a column in a RadGrid that has a customised Filter control. Rather than the standard text box, I have used the column's FilterTemplate to display a RadCombo list containing possible filter values. I have a couple of questions relating to this scenario.
In addition to the list, I would like to show the standard list of filter operators that normally appears next to the text box in filter controls. Does a control exist to implement this feature? How is it configured?
When the user selects a value from the list, in code-behind the filter is applied and the grid is rebound. As a result, the combo is repopulated and its SelectedValue property is initialised to null. However, I want the SelectedValue property to be set to the value the user has just selected, so that selecting all other items in the list produces the appropriate re-filtering action. How can I do that?
Suggestions welcome, thanks in advance!
<telerik:GridBoundColumn DataField="CaseStatus" FilterControlAltText="Filter status column"
HeaderText="Case Status" UniqueName="Status">
<FilterTemplate>
<telerik:RadComboBox runat="server" ID="ddlStatus" AutoPostBack="true"
OnSelectedIndexChanged="ddlStatus_SelectedIndexChanged">
</telerik:RadComboBox>
</FilterTemplate>
</telerik:GridBoundColumn>
protected void ddlStatus_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e)
{
string filterExpression = string.Format("CaseStatus = {0}", (byte)Enum.Parse(typeof(CaseStatus), e.Value));
rgResults.MasterTableView.FilterExpression = filterExpression;
rgResults.MasterTableView.Rebind();
}
In addition to the list, I would like to show the standard list of filter operators that normally appears next to the text box in filter controls. Does a control exist to implement this feature? How is it configured?
When the user selects a value from the list, in code-behind the filter is applied and the grid is rebound. As a result, the combo is repopulated and its SelectedValue property is initialised to null. However, I want the SelectedValue property to be set to the value the user has just selected, so that selecting all other items in the list produces the appropriate re-filtering action. How can I do that?
Suggestions welcome, thanks in advance!
<telerik:GridBoundColumn DataField="CaseStatus" FilterControlAltText="Filter status column"
HeaderText="Case Status" UniqueName="Status">
<FilterTemplate>
<telerik:RadComboBox runat="server" ID="ddlStatus" AutoPostBack="true"
OnSelectedIndexChanged="ddlStatus_SelectedIndexChanged">
</telerik:RadComboBox>
</FilterTemplate>
</telerik:GridBoundColumn>
protected void ddlStatus_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e)
{
string filterExpression = string.Format("CaseStatus = {0}", (byte)Enum.Parse(typeof(CaseStatus), e.Value));
rgResults.MasterTableView.FilterExpression = filterExpression;
rgResults.MasterTableView.Rebind();
}