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

GridView Filter value on Tab change

5 Answers 183 Views
GridView
This is a migrated thread and some comments may be shown as answers.
gerardo
Top achievements
Rank 1
Veteran
gerardo asked on 18 Feb 2021, 05:57 AM

Good day.

I have 3 Tabs. Each RadTabControl have a RadGridView inside. When I search/filter in RadGridView 1 inside Tab 1 then move to Tab 2 and go back to Tab 1, the search/filter on the RadGridView 1 is removed. How can I retain the filter value in RadGridView when I change Tabs.

Also I noticed that when I go back to Tab 1 with the RadGridView 1, the filtered value was removed and a BusyIndicator is blocking the RadGridView 1 and does not disappear.

 

Thank you.

5 Answers, 1 is accepted

Sort by
0
Dilyan Traykov
Telerik team
answered on 22 Feb 2021, 10:29 AM

Hello,

For performance optimization, the ControlTemplate of the RadTabControl defines a single ContentPresenter that holds only the currently selected RadTabItem's Content. Therefore each time the selection is changed the content of the last active item is unloaded in order to load the content of the newly selected item. Since the load/unload operations involve add/remove actions in the visual tree, the content (your RadGridView instances in this case) does not keep its state.

To keep the state of the controls inside the tab items, you can set the IsContentPreserved property of the RadTabControl to True as shown in this article:

<telerik:RadTabControl IsContentPreserved="True" 

Please give this a try and let me know if setting the property resolves your issue.

Regards,
Dilyan Traykov
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/.

0
gerardo
Top achievements
Rank 1
Veteran
answered on 22 Feb 2021, 01:49 PM

Thank you for your reply Sir. Now that its for performance optimization I think I'll leave it false now. 

But now what is happening is when I filtered GridView 1 in Tab 1 then go to Tab 2, and go back to Tab 1, a Busy indicator is showing covering the GridView 1 and not closing. I already tried to set isBusy property of GridView 1 to false. I also remove usage of RadBusyIndicator. 

0
Dilyan Traykov
Telerik team
answered on 25 Feb 2021, 09:24 AM

Hello,

Would you find it possible to demonstrate this undesired behavior in a small sample project (for which you can open a new support ticket or select a storage provider of your choice) or at least share some code snippets so that I can try to replicate it at my end?

Thank you in advance for your cooperation on the matter.

Regards,
Dilyan Traykov
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/.

0
gerardo
Top achievements
Rank 1
Veteran
answered on 28 Feb 2021, 12:01 PM

Good day Sir Dilyan. Thank you for your response.

 

I tried to create a new program to recreate the behavior and I found this GridView property.

<Setter Property="DataLoadMode" Value="Asynchronous"/>

This results the the behavior I am experiencing But only if I use a RadDataPager to my GridView.

 

I have tried the following

GridView without DataLoadMode=Asynchronous with RadDataPager - its working

GridView with DataLoadMode=Asynchronous without RadDataPager - its working

GridView with DataLoadMode=Asynchronous with RadDataPager - a busy indicator is displaying and not closing

0
Dilyan Traykov
Telerik team
answered on 01 Mar 2021, 03:15 PM

Hello,

As stated in the Tips and Tricks article, using the Asynchronous DataLoadMode is no longer recommended as it may lead to potential issues, such as the one you've described.

Could you please specify whether you actually require this property to be set and if so - what is the particular reason for this, so that I can suggest an alternative solution?

Regards,
Dilyan Traykov
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/.

Tags
GridView
Asked by
gerardo
Top achievements
Rank 1
Veteran
Answers by
Dilyan Traykov
Telerik team
gerardo
Top achievements
Rank 1
Veteran
Share this question
or