TableFilteringRow CheckBox

4 posts, 2 answers
  1. Dominik
    Dominik avatar
    82 posts
    Member since:
    Dec 2012

    Posted 05 Jun 2013 Link to this post

    Hi,

    I can set filltering for GridViewTextBoxColumn:
    dg.MasterView.TableFilteringRow.Cells[1].Value = "test";
    Unfortunately this does not work similarly for GridViewCheckBoxColumn:
    dg.MasterView.TableFilteringRow.Cells[2].Value = true;

    Version: 2013.1.321.40
  2. Answer
    Anton
    Admin
    Anton avatar
    167 posts

    Posted 10 Jun 2013 Link to this post

    Hi Dominik,

    Thank you for writing.

    The correct way to set filter is by creating FilterDescriptor, not by directly setting the cell value. Consider the following example:
    FilterDescriptor filter = new FilterDescriptor();
    filter.PropertyName = "column2";
    filter.Operator = FilterOperator.IsEqualTo;
    filter.Value = true;
    filter.IsFilterEditor = true;
    this.radGridView1.FilterDescriptors.Add(filter);

    You can read more about FilterDescriptor in our online documentation: http://www.telerik.com/help/winforms/gridview-filtering-setting-filters-programmatically-simple-descriptors.html

    I hope this helps.

    Regards,
    Anton
    Telerik
    RadChart for WinForms is obsolete. Now what?
  3. Dominik
    Dominik avatar
    82 posts
    Member since:
    Dec 2012

    Posted 20 Jun 2013 Link to this post

    The solution works fine but I had some problems with it.
    I was convinced that PropertyName = FieldName.
    This information I found in an example given: FilterDescriptor - implements filtering property (field) name. <- column1.FieldName?
    For this reason, when an earlier attempt to use this approach has not got any results.
    It turns out that the PropertyName = Name of column.

    // not this
    column1.FieldName = "sqlcol1";
     
    //or this
    column1.HeaderText = "header test";
     
    //but this one
    column1.Name = "column1";

    I think PropertyName is a little confusing, at least for me.
  4. Answer
    Anton
    Admin
    Anton avatar
    167 posts

    Posted 25 Jun 2013 Link to this post

    Hi Dominik,

    Thank you for writing back.

    We highly appreciate your feedback and we will consider it in a future version.

    Should you have any other questions, I will be glad to assist you.

    Regards,
    Anton
    Telerik
    RadChart for WinForms is obsolete. Now what?
Back to Top