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

Remove Filter Options based on Column DataType

1 Answer 142 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jeremy Yoder
Top achievements
Rank 1
Jeremy Yoder asked on 09 Feb 2010, 04:21 PM

I found how to remove various filter option for all columns, which I'm doing below...

    Protected Sub RadGrid1_Init(ByVal sender As ObjectByVal e As System.EventArgs) Handles RadGrid1.Init  
        Dim menu As GridFilterMenu = RadGrid1.FilterMenu  
        For n As Integer = menu.Items.Count - 1 To 0 Step -1  
            Select Case menu.Items(n).Text  
                Case "Between""NotBetween""IsEmpty""NotIsEmpty" 
                    menu.Items.RemoveAt(n)  
            End Select 
        Next 
    End Sub 

I also know I can custom filter each column. But is there a way to alter the base filters for a given DataType?

For instance, for all boolean columns, I'd like to remove "IsNull" and "NotIsNull", without removing those 2 options from the common string and integer filters. By doing it this way, rather than by column, I'll automatically take care of any boolean columns I add later. Is that possible?

1 Answer, 1 is accepted

Sort by
0
Accepted
Tsvetoslav
Telerik team
answered on 11 Feb 2010, 08:44 AM
Hi Jeremy,

The following help article has the answer to you question (see the client-side approach): http://www.telerik.com/help/aspnet-ajax/grdreducingfiltermenuoptions.html 

I hope it helps.

All the best,
Tsvetoslav
the Telerik team

Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Follow the status of features or bugs in PITS and vote for them to affect their priority.
Tags
Grid
Asked by
Jeremy Yoder
Top achievements
Rank 1
Answers by
Tsvetoslav
Telerik team
Share this question
or