Quantcast
Channel: Where to set GridView.PageIndex first time control is displayed
Viewing all articles
Browse latest Browse all 13

Re: Where to set GridView.PageIndex first time control is displayed

$
0
0

Jacob_Zac

PageIndex is properly set, but in gridview first page is displayed and not the last.

Pager buttons show that the last page is selected which is not the case.

Try setting the PagelIndex on pageload event like below

protected void Page_Load(object sender, EventArgs e)
        {

            if (!this.IsPostBack)
            {
                gridViewGuestEntries.PageIndex = Int32.MaxValue;
                //Your code to get the value
                //gridViewGuestEntries.DataSource = ;
                //gridViewGuestEntries.DataBind();
            }
        }

You can check this link for more details : http://forums.asp.net/t/1293215.aspx?Display+last+page+of+a+Gridview+Programmatically


Viewing all articles
Browse latest Browse all 13

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>