What events are triggerred when the expression is changed?

4 posts, 0 answers
  1. Bruce
    Bruce avatar
    12 posts
    Member since:
    Oct 2010

    Posted 11 Nov 2010 Link to this post

    Hi,

    When any field is changed in the filter expressions, the preview string is refreshed if the AllowFilterOnBlur property is set to true. Can you tell me which event is triggerred at that time? I need to add some code to do something when this happens. If there are events defined on the client side and on the server side, please list all of them.

    Thanks a lot!

    Bruce
  2. Vasil
    Admin
    Vasil avatar
    1547 posts

    Posted 16 Nov 2010 Link to this post

    Hello Bruce,

    AllowFilterOnBlur property gets or sets whether RadFilter should post-back when value in editor change.
    You can see all public events of the RadFilter here.

    Regards,
    Vasil
    the Telerik team
    Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Bruce
    Bruce avatar
    12 posts
    Member since:
    Oct 2010

    Posted 16 Nov 2010 Link to this post

    Hi Vasil,

    I don't see any events related to the expression change. I have a RadFilter control and a Textbox control on the page. When the user changes anything in the fitler (for example, the AND/OR dropdown, the filter field dropdown, the =/>/</Contains dropdown, the value TextBox, etc.), I want to parse the filter to a string and display it in the TextBox (It is similar to the preview function). My questions is where (which event handler?) I can put my code (either server code or client code).

    Thanks a lot.
    Bruce
  5. Vasil
    Admin
    Vasil avatar
    1547 posts

    Posted 18 Nov 2010 Link to this post

    Hi Bruce,

    ApplyExpressions is the event, which is fired when expression is changed.
    For example if you have RadGrid with SqlDataSource and RadFilter, you can use the code bellow.

    aspx:
    <telerik:RadFilter ID="RadFilter1" runat="server" AllowFilterOnBlur="true" OnApplyExpressions="RadFilter1_ApplyExpressions" FilterContainerID="RadGrid1">
    </telerik:RadFilter>
    <asp:Label ID="Label1" runat="server" Text=""></asp:Label>
    <telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="SqlDataSource1" GridLines="None">
        <MasterTableView DataSourceID="SqlDataSource1">
            <Columns>
                <telerik:GridBoundColumn DataField="ProductID" DataType="System.Int32" HeaderText="ProductID"
                    ReadOnly="True" SortExpression="ProductID" UniqueName="ProductID">
                </telerik:GridBoundColumn>
                  ..........
            </Columns>
        </MasterTableView>
        <HeaderContextMenu EnableImageSprites="True" CssClass="GridContextMenu GridContextMenu_Default">
        </HeaderContextMenu>
    </telerik:RadGrid>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:MyConnectionString%>"SelectCommand="SELECT * FROM [ SomeTable ]"></asp:SqlDataSource>
    cs:
    protected void RadFilter1_ApplyExpressions(object sender, Telerik.Web.UI.RadFilterApplyExpressionsEventArgs e)
    {
        RadFilterSqlQueryProvider provider = new RadFilterSqlQueryProvider();       
        provider.ProcessGroup(e.ExpressionRoot);
        Label1.Text = provider.Result;
    }
    You will need to choose RadFilterXXXProvider, which is suitable for your DataSource.

    There is property called ExpressionPreviewPosition of the RadFilter, which default value is "None".
    You can set ExpressionPreviewPosition="Top", to see the filter expression when browsing your page.

    Kind regards,
    Vasil
    the Telerik team
    Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Back to Top