Click here to Skip to main content
15,886,788 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi ...
when i click a button , i will show gridview...now i want to set the paging properties ,i had set allow paging and other properties.. that is working but now the problem is while changing to the next page, grid view is not refreshing and if i click again the button , the gridview is working..
can anyone tell me the solutions?

[edit]Subject only: try to give a concise summary of your problem, rather than the whole question in the subject - OriginalGriff[/edit]
Posted
Updated 12-Dec-11 20:56pm
v2

add a pageindexchanging event , ex:
C#
protected void gvCustomers_PageIndexChanging(object sender, GridViewPageEventArgs e)
  {
          gvCustomers.PageIndex = e.NewPageIndex;
          GridBind();//method to bind the gridview

  }
 
Share this answer
 
v2
Comments
Munirajant 13-Dec-11 3:42am    
tnx.............
call pageindexchanging event on click of page no. or "< >" sign.
set page index to new page index. it will do. try this.
 
Share this answer
 
Comments
Munirajant 13-Dec-11 3:42am    
tnx
HI check this event :

C#
protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)

{

      GridView1.PageIndex = e.NewPageIndex;

}



And please add your code in question for better help.
 
Share this answer
 
Comments
Munirajant 13-Dec-11 3:42am    
tnx
C#
protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
 
  GridView1.PageIndex = e.NewPageIndex;
  fillgrid1();//here bind dataset into gridview

}
 
Share this answer
 
Comments
Munirajant 13-Dec-11 3:42am    
tnx
Prince Antony G 13-Dec-11 7:12am    
ok

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900