Click here to Skip to main content
15,891,951 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi how can refresh the gridview pageindex when value can be changed... i can assign values to grid using several button. each button hasn't carrying same values. we can select one button and select 2nd page index in gridview then select another button the pageindex 2nd doesn't change.. how to refresh pageindex when i click other buttons..




Thanks & Regards
Nani
Posted
Updated 20-Dec-12 20:46pm
v2
Comments
StackQ 15-Dec-12 1:47am    
try after ur event:UrDataGridViewNaME.Refresh();
NaniCh 15-Dec-12 1:51am    
it doesn't calling..
StackQ 15-Dec-12 1:55am    
check for the appropriate event,or tell me after what process, u want to refresh ur gridview.

Give brief description about ur process:
NaniCh 15-Dec-12 2:09am    
i bind the gridview multiple times with multiple values. we bind values on pageload and select next pageindex after we can bind grid with another value the pageindex doesn't change
StackQ 15-Dec-12 2:13am    
we bind values on pageload
{Here call for refresh!!!!!!!}
and select next pageindex after we can bind grid with another value the pageindex doesn't change

Not sure, but you should go with it :
C#
Session["PageIndex"] = GridView1.PageIndex;

protected void Page_Load(object sender, EventArgs e)
 {
     if(!IsPostBack)
     {
        Gridview1.PageIndex =convert.ToInt32(Session["PageIndex"]);
     }
 }
 
Share this answer
 
Your page should render the correct page index. If you mean you want the page indexs you show as links to update as the data changes, the obvious way to do that is have your page auto refresh every minute or so.
 
Share this answer
 

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