Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET C#4.0
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 14-Dec-12 20:27pm
NaniCh709
Edited 20-Dec-12 21:46pm
v2
Comments
01010RAJ at 15-Dec-12 1:47am
   
try after ur event:UrDataGridViewNaME.Refresh();
NaniCh at 15-Dec-12 1:51am
   
it doesn't calling..
01010RAJ at 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 at 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
01010RAJ at 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
NaniCh at 15-Dec-12 2:16am
   
gridview.refresh() it doen't calling...
01010RAJ at 15-Dec-12 2:19am
   
ok,so create a function,put refresh code inside that function,and call that function where i specified.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Not sure, but you should go with it :
Session["PageIndex"] = GridView1.PageIndex;
 
protected void Page_Load(object sender, EventArgs e)
 {
     if(!IsPostBack)
     {
        Gridview1.PageIndex =convert.ToInt32(Session["PageIndex"]);
     }
 }
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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.
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 195
1 ProgramFOX 130
2 Maciej Los 105
3 Sergey Alexandrovich Kryukov 105
4 Afzaal Ahmad Zeeshan 82
0 OriginalGriff 6,564
1 Sergey Alexandrovich Kryukov 6,048
2 DamithSL 5,228
3 Manas Bhardwaj 4,717
4 Maciej Los 4,150


Advertise | Privacy | Mobile
Web04 | 2.8.1411022.1 | Last Updated 21 Dec 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100