Disable RadGrid Filter TextBox

3 posts, 1 answers
  1. Brian
    Brian avatar
    14 posts
    Member since:
    Aug 2013

    Posted 13 Aug 2015 Link to this post

    Hi,

    Is there a way to disable the RadGrid filter TextBox while keeping the filter button active and visible?  I'm using the button as a combo box and no longer need the TextBox.  Thanks for your help!

  2. Answer
    Eyup
    Admin
    Eyup avatar
    3009 posts

    Posted 18 Aug 2015 Link to this post

    Hi Brian,

    You can use the following approach to achieve this requirement:
    protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
    {
        if (e.Item is GridFilteringItem)
        {
            GridFilteringItem filterItem = e.Item as GridFilteringItem;
            TextBox textBox = filterItem["ShipName"].Controls[0] as TextBox;
            textBox.Enabled = false;
        }
    }

    In addition, you can use FilterTemplates:
    http://demos.telerik.com/aspnet-ajax/grid/examples/functionality/filtering/filter-templates/defaultcs.aspx

    I also suggest you to examine the samples provided in this post:
    http://www.telerik.com/forums/how-to-persist-dropdownlist-selected-index-and-value-on-postback-from-radgrid-filtertemplate#GW3MyQLmVEmy8XzsmrHzeQ

    Hope this helps.

    Regards,
    Eyup
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Brian
    Brian avatar
    14 posts
    Member since:
    Aug 2013

    Posted 18 Aug 2015 in reply to Eyup Link to this post

    Hi Eyup,

    That worked perfectly.  Thanks for the snippet!

Back to Top