This is a migrated thread and some comments may be shown as answers.

What events are triggerred when the expression is changed?

3 Answers 86 Views
Filter
This is a migrated thread and some comments may be shown as answers.
Bruce
Top achievements
Rank 1
Bruce asked on 12 Nov 2010, 12:51 AM
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

3 Answers, 1 is accepted

Sort by
0
Vasil
Telerik team
answered on 16 Nov 2010, 10:08 AM
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.
0
Bruce
Top achievements
Rank 1
answered on 16 Nov 2010, 06:22 PM
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
0
Vasil
Telerik team
answered on 18 Nov 2010, 04:18 PM
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.
Tags
Filter
Asked by
Bruce
Top achievements
Rank 1
Answers by
Vasil
Telerik team
Bruce
Top achievements
Rank 1
Share this question
or