RadGridView Column Filters

2 posts, 0 answers
  1. Rachel
    Rachel avatar
    2 posts
    Member since:
    May 2020

    Posted 08 Jun 2020 Link to this post

    We have used RadGridView in our Windows Application and initially we use 2012 year versions of respective telerik dll's.

    With those dll's on our specific form where we have used RadGridView, if user enter a filter value  to filter desired type of rows from all bunch of rows and close the and  reopen the form user can see his last entered filter value has been retained so the rows user can see are also filtered on the basis of filter value.

    But when tried to Upgrade to 2020 version of respective telerik dll's we observed above mentioned functionality does not work.

    Attached is the respective image of grid. Kindly assist on this.

     

  2. Nadya
    Admin
    Nadya avatar
    486 posts

    Posted 10 Jun 2020 Link to this post

    Hello Rachel,

    It seems to be a long version gap when you upgrade from 2012 to 2020 version. We have introduced a lot of improvements and new features regarding RadGridView and it is normal if some functionalities have changed since then.

    Currently, RadGridView allows adding a FilterDescriptor programmatically through the FilterDescriptors property. It stores FilterDescriptors used for the filtering operation in RadGridView. You can create a new FilterDescriptor, specify its PropertyName, Operator, and Value properties then assign it to the FilterDescriptor's collection. Thus, when you start the form the applied filter will be initially loaded. More information about filtering functionality you can find here: https://docs.telerik.com/devtools/winforms/controls/gridview/filtering/setting-filters-programmatically-(simple-descriptors).

    Please refer to the following code snippet:

    public RadForm1()
    {
        InitializeComponent();
        this.radGridView1.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;
        this.radGridView1.EnableFiltering = true;
    
        FilterDescriptor filter = new FilterDescriptor();
        filter.PropertyName = "Title";
        filter.Operator = FilterOperator.Contains;
        filter.Value = "Representative";
        filter.IsFilterEditor = true;
        this.radGridView1.FilterDescriptors.Add(filter);
    }
    
    private void RadForm1_Load(object sender, EventArgs e)
    {
        this.employeesTableAdapter.Fill(this.nwindDataSet.Employees);
    }

    I hope this helps. If you have other questions do not hesitate to ask.

    Regards,
    Nadya
    Progress Telerik

    Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
    Our thoughts here at Progress are with those affected by the outbreak.
Back to Top