开发者

How to remove filter button on Telerik RadGrid

开发者 https://www.devze.com 2023-02-04 12:51 出处:网络
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, u

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 !


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


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);
        }
}
0

精彩评论

暂无评论...
验证码 换一张
取 消