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

[Solved] NeedDataSource called twice on paging

1 Answer 459 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Alex
Top achievements
Rank 1
Alex asked on 18 May 2009, 11:31 PM
I am using Telerik Grid 2008.03.1125.35 with data stamp 08-11-24. Just tried 2009.1 402 and got the same results.

I cannot find out why NeedDataSource on my grid is called twice on paging.

Following observation

- It is only called twice on paging. Initial load and sorting work properly.
- It is only called twice with EnableViewState=false. If I enable ViewState - NeedDataSource will be called once.
- Sequence of events - NeedDataSource, PageIndexChanged, NeedDataSource

Any ideas on what I need to check? Page is rather big to post here, but grid definition is below

I already checked similar threads and following links and could not solve the problem

http://www.telerik.com/help/aspnet-ajax/grdcommandsthatinvokerebindimplicitly.html
http://www.telerik.com/help/aspnet-ajax/grdeventsequence.html
http://www.telerik.com/help/aspnet-ajax/grdviewstateoptimization.html

http://www.telerik.com/help/aspnet-ajax/grdeventsequence.html


Thank you


-----------------

<telerik:RadGrid ID="shipmentsGrid"
                OnSortCommand="Grid_SortCommand"
                OnPageIndexChanged="Grid_PageIndexChanged"
                OnItemDataBound="Grid_ItemDataBound"
                OnPreRender="Grid_PreRender"
                Skin="MyShipRush"
                EnableEmbeddedSkins="false"
                ImagesPath="/styles/rad/Grid/"
                Width="99%"
                AllowSorting="True"
                PageSize="15"
                EnableAJAXLoadingTemplate="True"  
                EnableAJAX="True"
                AllowPaging="True"
                AllowCustomPaging = "true"
                AllowMultiRowSelection="False"
                PagerPosition="TopAndBottom"
                runat="server"
                Gridlines="None"
                AutoGenerateColumns="False"
                OnNeedDataSource="Grid_NeedDataSource"
                EnableViewState="false" >


1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 19 May 2009, 04:54 AM
Hi Alex,

NeedDataSource will be called twice since the ViewState of the grid is disabled. You may refer the following help article for getting more details on this.
http://www.telerik.com/help/aspnet-ajax/grdrebindgridoncommandwithdatasourcepersistencemodenopersistence.html

Shinu.
Tags
Grid
Asked by
Alex
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or