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

CurrentFilterFunction with filter menu subset

1 Answer 89 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Curt
Top achievements
Rank 1
Curt asked on 28 Jul 2008, 06:21 PM
I do the following to get a subset of the grid filter options:
protected void RadGridFilter_Init(object sender, System.EventArgs e) 
    { 
        RadGrid rg = (RadGrid)sender; 
        GridFilterMenu menu = rg.FilterMenu; 
        int i = 0; 
 
        while (i < menu.Items.Count) 
        { 
            if (menu.Items[i].Text == "NoFilter" || menu.Items[i].Text == "Contains" || menu.Items[i].Text == "EqualTo" || menu.Items[i].Text == "GreaterThan" 
             || menu.Items[i].Text == "LessThan" || menu.Items[i].Text == "StartsWith"
            { 
                i++; 
            } 
            else 
            { 
                menu.Items.RemoveAt(i); 
            } 
        } 
         
 
    } 






This works fine unless you combine it with:
CurrentFilterFunction="EqualTo" (or another option besides Contains).

It appears the grid first sets the index of the current filter function and then removes the filter features with the OnInit command.  This puts the wrong item as the default.

I really don't want to have to iterate through each column on every grid I have in the code to set the default.  Is this a big or by design?  Any quick ways of getting a subset of the filter options and then set the default filter value?

Thanks





1 Answer, 1 is accepted

Sort by
0
Iana Tsolova
Telerik team
answered on 31 Jul 2008, 03:38 PM
Hi sl6rp,

I followed your scenario and was able to replicate the problem. But it seems that we will to make further tests and investigations on that issues is order to find a resolution for your.

Please excuse us for the inconvenience.

Greetings,
Iana
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
Curt
Top achievements
Rank 1
Answers by
Iana Tsolova
Telerik team
Share this question
or