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

Apply filter without opening filter pop up

5 Answers 89 Views
DataFilter
This is a migrated thread and some comments may be shown as answers.
Julian
Top achievements
Rank 1
Julian asked on 13 Dec 2010, 10:19 AM
Hi,

I'd like to set my custom filter in datagrid with some values without opening filter pop-up.

As far as I understand for that purpose I have to call somehow method Prepare(GridViewBoundColumnBase gridViewColumn) of my filter to initialize my filter.

Can you please tell me or better show me, how can I clever handle such situation.

Thank u in advance,
Julian 

5 Answers, 1 is accepted

Sort by
0
Veselin Vasilev
Telerik team
answered on 13 Dec 2010, 10:41 AM
Hello Julian,

You can define a ColumnFilterDescriptor in the code and add it to the FilterDescriptors collection of the RadGridView. Thus it will pre-filter the data. You can see this help topic on the matter.

All the best,
Veselin Vasilev
the Telerik team
Browse the videos here>> to help you get started with RadControls for WPF
0
Julian
Top achievements
Rank 1
answered on 13 Dec 2010, 10:58 AM
Could u please provide me with a couple of lines of code ?

thx.
Julian

0
Veselin Vasilev
Telerik team
answered on 13 Dec 2010, 11:10 AM
Hi Julian,

I must have given you a wrong link, please excuse me. The correct one is this:
http://www.telerik.com/help/wpf/radgridview-filtering-column-filter-descriptors.html

Attached you can find a sample project.

Regards,
Veselin Vasilev
the Telerik team
Browse the videos here>> to help you get started with RadControls for WPF
0
Julian
Top achievements
Rank 1
answered on 13 Dec 2010, 11:28 AM
Thank you.

But in my situation I have custom filter control. The implementation of that is located in another file - CustomFilterControl.

it means that I can't call directly the grid from my control.

thx.
Julian
0
Veselin Vasilev
Telerik team
answered on 13 Dec 2010, 01:44 PM
Hello Julian,

The custom filter control should know about the column it is in. Having the column, you can access the gridview via its DataControl property.

Regards,
Veselin Vasilev
the Telerik team
Browse the videos here>> to help you get started with RadControls for WPF
Tags
DataFilter
Asked by
Julian
Top achievements
Rank 1
Answers by
Veselin Vasilev
Telerik team
Julian
Top achievements
Rank 1
Share this question
or