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

[Solved] NeedDataSource called for all AjaxSetting controls

2 Answers 83 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Kristoffer Ryden
Top achievements
Rank 1
Kristoffer Ryden asked on 04 Aug 2009, 10:20 PM

I have 5 RadGrids on a page, registered with RadAjaxManager (AddAjaxSetting(grid, grid, loadingpanel)).

All grids use paging and hook the NeedDataSource() event. 

When I page through one grid, there is no full page refresh, the loading panel appears as expected and paging functions correctly. 

However, when I investigated the very slow paging I discovered that NeedDataSource (and infact all the lifecycle events) was firing on all 5 grids and not just the one that I was actually paging.

Is there any way that the RadAjaxManager could be refreshing all it's AjaxSettings regardless of which control is the trigger?

Thanks,

brian

2 Answers, 1 is accepted

Sort by
0
Kristoffer Ryden
Top achievements
Rank 1
answered on 07 Aug 2009, 08:02 PM


One of my grids had EnableViewState set to false.  Removing that fixed the issue, only the expected grids posted back.

I was aware that disabling viewstate would cause some extra postbacks but I did not expect one grids settings to mess up the entire page.

Anyway, posting here in case someone has a similar issue.

Brian
0
Yavor
Telerik team
answered on 10 Aug 2009, 06:08 AM
Hello Kristoffer,

Indeed, in such a scenario the NeedDataSource event handlers for all the grids will be raised. In scenarios like this, it is also recommended to keep the ViewState on, to ensure that the controls work as expected. I hope the setup is functioning as per your requirements now.
Thank you for posting the solution to the community - I am sure it will be useful.

All the best,
Yavor
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Ajax
Asked by
Kristoffer Ryden
Top achievements
Rank 1
Answers by
Kristoffer Ryden
Top achievements
Rank 1
Yavor
Telerik team
Share this question
or