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

FilterDescriptor programmatically

2 Answers 51 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Boukerroui
Top achievements
Rank 1
Boukerroui asked on 16 Jan 2015, 01:24 PM
Telerik Version = Q3 2012

I add a FilterDescriptor to GridView like this, bat i can't activate the visual state in GridView (property = IsActive)
FilterDescriptor filter = new FilterDescriptor();
filter.Member = "Code";
filter.Operator = FilterOperator.IsNotEqualTo;
filter.Value = MyObject.Code;                              
this.GridSource.FilterDescriptors.Add(filter);
How can i set IsActive to True?

Best regards

2 Answers, 1 is accepted

Sort by
0
Boukerroui
Top achievements
Rank 1
answered on 20 Jan 2015, 04:51 PM
Hi,
I construct the filter likke this
GridViewColumn CodeFColumn = this.GridSource.Columns["Present"];
IColumnFilterDescriptor CodeFFilter = CodeFColumn.ColumnFilterDescriptor;
CodeFFilter.SuspendNotifications();
CodeFFilter.FieldFilter.Filter1.Operator = FilterOperator.IsEqualTo;
CodeFFilter.FieldFilter.Filter1.Value = true;
CodeFFilter.ResumeNotifications();
It's work find, bat in popup of the filter the value is not ckeked (like screenshot)

0
Boris
Telerik team
answered on 21 Jan 2015, 11:59 AM
Hello Boukerroui

By design the distinct filter values cannot be checked programmatically. That is why the CheckBox with the "True" distinct value is not checked. It might be possible to create a custom filtering control that can does that, by following the Custom Filtering Control documentation article and the CustomFilterControl SDK example. However, the specific implementation of the desired logic is up to you, since it's entirely custom.

I hope this helps.

Regards,
Boris
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
GridView
Asked by
Boukerroui
Top achievements
Rank 1
Answers by
Boukerroui
Top achievements
Rank 1
Boris
Telerik team
Share this question
or