RadFilter Menu Items.

Thread is closed for posting
2 posts, 0 answers
  1. Gowtham
    Gowtham avatar
    3 posts
    Member since:
    Jul 2013

    Posted 05 Aug 2013 Link to this post


    My requirement is to disable the menu items in the RadFilter. Let me explain it, I have a RadFilter linked dynamically to a RadGrid. On load  he RadFilter opens with a predefined expression. Now i need to change the Data Field and filter function drop down boxes such that , only the first value is set and user will not be allowed to access the drop down box.

    I have attached the screenshot, in that i need to set the value as TASK and CONTAINS then the drop down should be diabled
  2. Antonio Stoilkov
    Antonio Stoilkov avatar
    530 posts

    Posted 08 Aug 2013 Link to this post

    Hello Gowtham,

    In order to achieve your scenario you could subscribe to RadFilter OnExpressionItemCreated event, access the choosers and set their Enable property to false as shown below.
    protected void RadFilter1_ExpressionItemCreated(object sender, Telerik.Web.UI.RadFilterExpressionItemCreatedEventArgs e)
        RadFilterSingleExpressionItem singleExpressionItem = e.Item as RadFilterSingleExpressionItem;
        if (singleExpressionItem != null)
            singleExpressionItem.FieldNameChooserLink.Enabled = false;
            singleExpressionItem.FilterFunctionChooserLink.Enabled = false;

    Additionally, you could set default FilterFunction and FieldName by using the new RadFilter.DefaultFieldEditorFieldName and each field editor DefaultFilterFunction properties.
    <telerik:RadFilter ID="RadFilter1" runat="server" OnFieldEditorCreating="RadFilter1_FieldEditorCreating" OnExpressionItemCreated="RadFilter1_ExpressionItemCreated"
            <telerik:RadFilterTextFieldEditor FieldName="Task" DefaultFilterFunction="Contains" />

    Antonio Stoilkov
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Back to Top