By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,058 Members | 1,213 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,058 IT Pros & Developers. It's quick & easy.

Datagrid Paging

P: n/a
hi
I got a datagrid with Paging enabled which is getting populated thru a
stored proc.

I've given the code in the event

grid.CurrentPageIndex = e.NewPageIndex
grid.VirtualItemCount = //COUNT FROM STORED PROC
grid.Datasource =a;
grid.DataBind();

but the paging is not working correctly.The link for the paging ( even if it
is page number or 'Prev Next" ) gives the link of the start page( the inital
pageload condition )

ie javascript:__doPostBack('grid$_ctl1$_ctl0','') and
javascript:__doPostBack('grid$_ctl1$_ctl1','') for Prev and Next links
always

What should i do more to make the link work

Thanks in advance

Nov 18 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Hi Happy..
Can you try posting some code where the error is?
Patrick
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #2

P: n/a
hi,

The code logic that i've used is : in the stored proc i'm getting the table
data into a temporary table and getting the excat no: of rows to the .net
application. ( the same logic for paging).

and ive given the code behid as ( in the pageindex change event )

grid.CurrentPageIndex = e.NewPageIndex
//count as an output parameter from stored proc
grid.VirtualItemCount = COUNT
grid.Datasource =dataset;
grid.DataBind();

BTW i'm using EnableViewState=false for the datagrid.

Thanks

"Patrick Olurotimi Ige" <pa*********@crazyjohns.com.au> wrote in message
news:eS*************@TK2MSFTNGP12.phx.gbl...
Hi Happy..
Can you try posting some code where the error is?
Patrick
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 18 '05 #3

P: n/a
hi
ive found out that if in the grid ViewState is enabled then it is working
fine. but when i disable it i have to populate it in the pageload again ( IF
isPostBack ).
ie 2 consicutive LoadGrid call.

Is ther any workaround for this.
how can i use paging with viewstate disabled

Thanks
"Happy" <ha***@nospam.com> wrote in message
news:O#**************@TK2MSFTNGP14.phx.gbl...
hi,

The code logic that i've used is : in the stored proc i'm getting the table data into a temporary table and getting the excat no: of rows to the .net
application. ( the same logic for paging).

and ive given the code behid as ( in the pageindex change event )

grid.CurrentPageIndex = e.NewPageIndex
//count as an output parameter from stored proc
grid.VirtualItemCount = COUNT
grid.Datasource =dataset;
grid.DataBind();

BTW i'm using EnableViewState=false for the datagrid.

Thanks

"Patrick Olurotimi Ige" <pa*********@crazyjohns.com.au> wrote in message
news:eS*************@TK2MSFTNGP12.phx.gbl...
Hi Happy..
Can you try posting some code where the error is?
Patrick
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


Nov 18 '05 #4

P: n/a
Hi Happy,
Try looking at this article it will give u an idea how pagination
WORKS..
Its at :- http://www.microsoft.com/india/msdn/articles/60.aspx
Be happy Mr Happy..
Enjoy!
Patrick

"Happy" wrote:
hi
ive found out that if in the grid ViewState is enabled then it is working
fine. but when i disable it i have to populate it in the pageload again ( IF
isPostBack ).
ie 2 consicutive LoadGrid call.

Is ther any workaround for this.
how can i use paging with viewstate disabled

Thanks
"Happy" <ha***@nospam.com> wrote in message
news:O#**************@TK2MSFTNGP14.phx.gbl...
hi,

The code logic that i've used is : in the stored proc i'm getting the

table
data into a temporary table and getting the excat no: of rows to the .net
application. ( the same logic for paging).

and ive given the code behid as ( in the pageindex change event )

grid.CurrentPageIndex = e.NewPageIndex
//count as an output parameter from stored proc
grid.VirtualItemCount = COUNT
grid.Datasource =dataset;
grid.DataBind();

BTW i'm using EnableViewState=false for the datagrid.

Thanks

"Patrick Olurotimi Ige" <pa*********@crazyjohns.com.au> wrote in message
news:eS*************@TK2MSFTNGP12.phx.gbl...
Hi Happy..
Can you try posting some code where the error is?
Patrick
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Nov 18 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.