Datagrid larger numbered pages not working

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



DataGrid1.DataBind() is not re-bind data source.
datagrid.DataBind() itself is only processing after data
binding. Following code shows data binding:

DataGrid1.DataSource = dataset; //or datatable, dataview
DataGrid1.DataBind();


HTH

Elton Wang
elton_Wang@xxxxxxxxxxx

>-----Original Message-----
>I didn't recieve any information to help me before so I'm
posting this again
>with edits...
>
>I have a datagrid that only shows 2 items per page. The
page numbers appear
>at the bottome of each page for the user to page through
the list. It shows
>1 through 10 and the links for pages 1 through 10 work
properly.
>
>After the "10" link there is a "..." link. If I click
the "..." link I can
>see
>page numbers 11 through 20 and another "..." link. My
basic problem is
>that these pages don't show the correct information. If
I click the link
>for "12", then the page goes to page "3" instead
of "12". So basically,
>it's treating the link as 1 through 10 instead of 11
through 20.
>
>Also, I click the next "..." link, it sends me back to
the first 1 through
>10 pages instead of 21 through 30. I know there are
enough items that
>34 pages should show up.
>
>Code to change the page is as follows:
>
>private void DataGrid1_PageIndexChanged(object source,
>System.Web.UI.WebControls.DataGridPageChangedEventArgs e)
>
>{
>
>this.DataGrid1.CurrentPageIndex = e.NewPageIndex;
>
>if (this.mdsDataSource != null) //Makes sure the
dataset is still
>available to the page
>
>this.DataGrid1.DataBind(); //Rebinds the dataset to
the datagrid
>
>}
>
>
>.
>
.



Relevant Pages

  • Re: Datagrid larger numbered pages not working
    ... > DataGrid1.DataBindis not re-bind data source. ... Following code shows data binding: ... >>I have a datagrid that only shows 2 items per page. ... >>that these pages don't show the correct information. ...
    (microsoft.public.dotnet.framework.aspnet.datagridcontrol)
  • data binding a datagrid in a UserControl
    ... I'm having major problems with a userControl which contains a datagrid. ... The Page_Loadprocedure calls the DataBind procedure to bind the ... If i include an if statement to prevent the data binding from occuring ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: data binding a datagrid in a UserControl
    ... Microsoft Certified Solution Developer - Early Achiever ... I'm having major problems with a userControl which contains a datagrid. ... If i include an if statement to prevent the data binding from occuring ... on a page PostBack in the following way: ...
    (microsoft.public.dotnet.framework.aspnet)
  • newbie with asp .net, databind and code behind
    ... I am starting out with asp .net and data binding with code behind. ... to integrate it with a control such as a datagrid. ...
    (microsoft.public.dotnet.framework.aspnet)