title: Paging Next in DataGrid in Asp.net C# Not Working
body: <p>I am trying to do paging of data. Basically I am taking a data and want to show it on multi pages. But it is not working.
  I am using Asp.net and C# for coding. I am using mysql as database.</p>
  
  <p>Code is as follows : 
  ASP code </p>
  
  <pre><code>&lt;asp:DataGrid runat="server" ID="RestData"
       AllowPaging="True" PageSize="2" 
       OnPageIndexChanged="RestData_PageIndexChanged" AllowCustomPaging="True" 
       PagerStyle-Wrap="False"&gt;
       &lt;PagerStyle /&gt;
  &lt;/asp:DataGrid&gt;
  </code></pre>
  
  <p>C# code:</p>
  
  <pre><code>protected void Page_Load(object sender, EventArgs e)
   {
      BindData();
   }
  public void BindData()
      {
       RestData.DataSource = call.GetReader(Convert.ToInt32(AreaData.SelectedValue));  
         //GetReader is function which returns the data reader of mysql 
       RestData.DataBind();
      }
  protected void RestData_PageIndexChanged(object source, DataGridPageChangedEventArgs e)
      {
         RestData.CurrentPageIndex = e.NewPageIndex;
          BindData();
     }
  </code></pre>
  
  <p>Output : 
  It is displaying two rows(as i have given pagesize 2). But I am not able to see next page.
  The query should returns more than 2 rows(it does happen when i use repeater but i am not able to do paging in it. </p>
  
  <p>Please provide some solution ( I was not able to solve my question with any other solution 
  in this forum so i have created new one)</p>
  
  <p>THANKS in ADVANCE.</p>