Problem with filtering and events in RadGrid

1 Answer 18 Views
GridView
Cesar
Top achievements
Rank 1
Cesar asked on 25 Sep 2025, 11:47 AM

Hi;

I have a problem that I don't know how to solve.

I have a grid with several columns and rows containing different data types (text, numbers, images, etc.). Some of the cells are formatted using the RowFormatting event.

The grid also allows filtering by column.

I noticed that when my grid has many rows and is filtered, scrolling becomes very slow. If it's not filtered, it works perfectly with the same number of rows.

After investigating further, I realized that the FilterChanged event is being triggered multiple times when scrolling.

Furthermore, the value of MasterView.Rows.Count is different each time the event is executed. Sometimes it shows the filtered count, and other times it shows the unfiltered count.

This, in addition to the slowness, is a serious problem. For example, if I have a thread running that performs an action on filtered rows, I encounter issues with indexing and incorrect row selection.

I've attached a sample project. If you filter by a column and then scroll, the number of rows in the MasterView will be displayed in the text box.

Could you help me to solve this problem?

Thank you so much.

Regards

1 Answer, 1 is accepted

Sort by
0
Dinko | Tech Support Engineer
Telerik team
answered on 30 Sep 2025, 07:46 AM

Hi Cesar,

The provided project is greatly appreciated. I was able to reproduce the described behavior. Indeed, the performance is hit when the control is filtered. I have investigated the project and found out that this comes from the RowFormatting event. This event is called quite often in numerous scenarios, along with scrolling. In general, setting the Value property anyway will trigger the filter again. This is the default behavior. Whether the user edits a cell value or when the cell value is changed in code, the filter will be re-applied. 

That is why in the test project, scrolling the control while it is filtered is a slow operation. If we remove the code in the RowFormatting event, you can observe that the described behavior is no longer observed. What I can suggest is to use Bound Mode instead of Unbound Mode. You can create a custom object that will have several properties, two of which will be of the Image type. In the getter, you can set your custom logic to return the correct image depending on the values of the Text properties.

I have modified your project to demonstrate this approach. As the columns are already generated, I have set the FieldName property of each column in the Form1.Designer.cs file. This way, the scrolling performance of the control won't be affected.

Regards,
Dinko | Tech Support Engineer
Progress Telerik

Your perspective matters! Join other professionals in the State of Designer-Developer Collaboration 2025: Workflows, Trends and AI survey to share how AI and new workflows are impacting collaboration, and be among the first to see the key findings.
Start the 2025 Survey
Tags
GridView
Asked by
Cesar
Top achievements
Rank 1
Answers by
Dinko | Tech Support Engineer
Telerik team
Share this question
or