New to Telerik UI for ASP.NET AJAXStart a free 30-day trial

Save filter expression text

Environment

ProductRadFilter for ASP.NET AJAX

Savinng the filter expression text

Description

Sometimes, one might want to save the filter expressions (the text that comes from the filter after the ExpressionPreviewPosition property has been set) for a specific use.

Solution

You can save the filter expression by using the ItemCommand event and getting the corresponding FieldName, FilterExpression, and Value properties.

ASP.NET
<telerik:radfilter runat="server" id="RadFilter1" filtercontainerid="RadGrid1"
    expressionpreviewposition="Bottom" onitemcommand="RadFilter1_ItemCommand" />

<asp:Label Text="" ID="Label1" runat="server" />

<telerik:radgrid runat="server" id="RadGrid1" autogeneratecolumns="false" width="600px" allowpaging="true" allowsorting="true" datasourceid="SqlDataSource1">
    <mastertableview>
        <columns>
            <telerik:gridboundcolumn datafield="OrderID" headertext="OrderID" datatype="System.Int32" />
            <telerik:gridboundcolumn datafield="ShipCity" headertext="ShipCity" />
            <telerik:gridboundcolumn datafield="ShipName" headertext="ShipName" />
        </columns>
    </mastertableview>
</telerik:radgrid>
<asp:SqlDataSource runat="server" ID="SqlDataSource1"
    ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
    SelectCommand="Select OrderID, ShipName, ShipCity FROM Orders"></asp:SqlDataSource>
In this article
EnvironmentDescriptionSolution
Not finding the help you need?
Contact Support