FilterDescriptor programmatically

3 posts, 0 answers
  1. Boukerroui
    Boukerroui avatar
    4 posts
    Member since:
    Oct 2011

    Posted 16 Jan 2015 Link to this post

    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;                              
    How can i set IsActive to True?

    Best regards
  2. Boukerroui
    Boukerroui avatar
    4 posts
    Member since:
    Oct 2011

    Posted 20 Jan 2015 in reply to Boukerroui Link to this post

    I construct the filter likke this
    GridViewColumn CodeFColumn = this.GridSource.Columns["Present"];
    IColumnFilterDescriptor CodeFFilter = CodeFColumn.ColumnFilterDescriptor;
    CodeFFilter.FieldFilter.Filter1.Operator = FilterOperator.IsEqualTo;
    CodeFFilter.FieldFilter.Filter1.Value = true;
    It's work find, bat in popup of the filter the value is not ckeked (like screenshot)

  3. Boris
    Boris avatar
    276 posts

    Posted 21 Jan 2015 Link to this post

    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.


    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.

Back to Top