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

DropDownList as TemplateColumn filter

3 Answers 35 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Pether Wiklander
Top achievements
Rank 2
Pether Wiklander asked on 28 Oct 2008, 05:03 PM
Hi,

I'm trying to implement a DropDownList as a filter for one of my TemplateColumns I'm not quite there yet.
I want the DropDownList to automatically filter my list whenever I change the value of the DropDownList. Are there any code examples covering this? AutoPostBack whenever I change the selected item in it.

Basically... this is what I want to achieve:

Filtering template columns

...but I can't seem to find the code for how to do it. Please help!

// Pether

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 29 Oct 2008, 04:14 AM
Hi Pether,

Here is a help article which expalins how you can implement filtering with DropDownList instead of a TextBox.
Filtering with MS DropDownList instead of textbox

Thanks
Shinu.
0
Pether Wiklander
Top achievements
Rank 2
answered on 29 Oct 2008, 10:28 AM
I'm not sure how to add a "All" item. I've tried to set

CurrentFilterFunction = GridKnownFunction.NoFilter;
CurrentFilterValue = String.Empty;

when that item is selected but without any luck. Any suggestions?

// Pether
0
Sebastian
Telerik team
answered on 29 Oct 2008, 11:09 AM
Hello Pether,

You also need to set the MasterTableView.FilterExpression property of the grid to an empty string (in order to clear the previously applied filters) and rebind the control invoking its Rebind() method. Review the [Clear filters] button OnClick server handler on this online demo for more details.

Best regards,
Stephen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
Pether Wiklander
Top achievements
Rank 2
Answers by
Shinu
Top achievements
Rank 2
Pether Wiklander
Top achievements
Rank 2
Sebastian
Telerik team
Share this question
or