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

Disable RadGrid Filter TextBox

2 Answers 57 Views
Filter
This is a migrated thread and some comments may be shown as answers.
Brian
Top achievements
Rank 2
Brian asked on 13 Aug 2015, 12:15 PM

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 Answers, 1 is accepted

Sort by
0
Accepted
Eyup
Telerik team
answered on 18 Aug 2015, 09:31 AM
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
0
Brian
Top achievements
Rank 2
answered on 18 Aug 2015, 11:52 AM

Hi Eyup,

That worked perfectly.  Thanks for the snippet!

Tags
Filter
Asked by
Brian
Top achievements
Rank 2
Answers by
Eyup
Telerik team
Brian
Top achievements
Rank 2
Share this question
or