Datagrid Paging

H

Happy

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
 
H

Happy

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
 
H

Happy

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top