With SearchRow in Gridview is there a way to auto filter results?

1 Answer 159 Views
GridView
Josh Fredrickson
Top achievements
Rank 1
Josh Fredrickson asked on 04 Oct 2022, 02:56 PM

There is an application I wrote many years ago that queries Active Directory and allows a searchable directory for our users.

Now that I have the Telerik Libraries I'm considering whether converting to a GridView with a SearchRow might be a suitable replacement.

In the previous version of the application I would type in part of the users name and it would only show the users with a match.

In the Telerik Gridview using a Searchrow it finds the same users, and more, but doesn't filter the users.  I would like it to only display the users where there is a match.

Also is there a way to customize the look of the search row? I would like to remove the entries highlighted on the right side as they aren't necessary.  I would also like the search row box to extend all the width of the form.

1 Answer, 1 is accepted

Sort by
0
Maria
Telerik team
answered on 06 Oct 2022, 01:32 PM

Hi Joshua,

Thank you for the images.

According to what you are trying to achieve, I suggest you using the Custom Filtering functionality in RadGridView. Thus, you don't need the search row if you just want to display only the users when there is a match. Custom Filtering is a flexible mechanism for filtering in the RadGridView rows using custom logic. It is applied if user filtering is enabled using the EnableFiltering property. I am sending you a link to the documentation for more information that can be helpful for you: Custom Filtering 

You just have to add a RadTextBox in the Designer and subscribe for the TextChanged event.

private void RadTextBox1_TextChanged(object sender, EventArgs e)
{
    this.radGridView1.MasterTemplate.Refresh();
}

Also, you can see our example for custom filtering in the Demo Application, which I think is exactly what you are looking for in your case.

I hope this helps you!

Regards,
Maria
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Josh Fredrickson
Top achievements
Rank 1
commented on 06 Oct 2022, 01:57 PM

Thanks Maria!

I'll try to test this out when I have more time after lunch today!

Tags
GridView
Asked by
Josh Fredrickson
Top achievements
Rank 1
Answers by
Maria
Telerik team
Share this question
or