Olof
Olof

Reputation: 544

How to remove filter button on Telerik RadGrid

I'm really new to asp.net and Telerik...

I have a RadGrid with filtering. I set AutoPostBackOnFilter="true" and CurrentFilterFunction="Contains" on my columns. Ok it works fine, user don't have to open drop-down list to select type of filter. But now, I want to hide filter buttons.

Possible ?

Thank you !

Upvotes: 2

Views: 6227

Answers (2)

Vasile Tomoiaga
Vasile Tomoiaga

Reputation: 1747

You can call .Filterable(false) on the column definition.

@{ Html.Telerik().Grid(Model)
        .Name("Grid")
        .DataKeys(keys => keys.Add(m => m.ID))
        .Columns(columns =>
        {
            columns.Bound(m => m.Name).Filterable(false);
            columns.Bound(m => m.Category).Filterable(false);
        }
}

Upvotes: 0

LaGrandMere
LaGrandMere

Reputation: 10359

You can use this :

        <script type="text/javascript">
            function showFilterItem(){
                $find('<%=RadGrid1.ClientID %>').get_masterTableView().showFilterItem();
            }
            function hideFilterItem(){
                $find('<%=RadGrid1.ClientID %>').get_masterTableView().hideFilterItem();
            }
        </script>

If you want to know more about Telerik Grids in ASP.Net, looak at the demos, there you can see samples of code : http://demos.telerik.com/aspnet-ajax/grid/examples/generalfeatures/filtering/defaultcs.aspx

Upvotes: 2

Related Questions