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

RadGridView Column Filters

1 Answer 533 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Rachel
Top achievements
Rank 1
Rachel asked on 08 Jun 2020, 11:27 AM

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.

 

1 Answer, 1 is accepted

Sort by
0
Nadya | Tech Support Engineer
Telerik team
answered on 10 Jun 2020, 12:06 PM

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.
Tags
General Discussions
Asked by
Rachel
Top achievements
Rank 1
Answers by
Nadya | Tech Support Engineer
Telerik team
Share this question
or