title: The DropDownList can't change the page in gridview
body: <pre><code>    &lt;table class=&quot;rwd-table&quot; id=&quot;tab&quot; runat=&quot;server&quot;  visible=&quot;false&quot;&gt; 
             &lt;tr&gt;
              &lt;td &gt;123&lt;/td&gt;
              &lt;td  &gt;2019/8/6&lt;/td&gt;
              &lt;td&gt; Designer&lt;/td&gt;
             &lt;/tr&gt;                       
  
             &lt;tr&gt;
              &lt;td&gt;1234&lt;/td&gt;
              &lt;td&gt;2019/8/7&lt;/td&gt;
              &lt;td&gt; Designer&lt;/td&gt;
             &lt;/tr&gt;                     
             &lt;tr&gt;
              &lt;td  &quot;&gt;1235&lt;/td&gt;
              &lt;td  &gt;2019/8/16&lt;/td&gt;
              &lt;td &gt; Des&lt;/td&gt;
             &lt;/tr&gt;
             &lt;tr&gt;
              &lt;td &gt;1412&lt;/td&gt;
              &lt;td &gt;2019/8/26&lt;/td&gt;
              &lt;td &gt; Designer&lt;/td&gt;
             &lt;/tr&gt;
             &lt;tr&gt;
              &lt;td &gt;5123&lt;/td&gt;
              &lt;td  &gt;2019/9/6&lt;/td&gt;
              &lt;td &gt; Designer&lt;/td&gt;
             &lt;/tr&gt;
             &lt;tr&gt;
              &lt;td &gt;2123&lt;/td&gt;
              &lt;td &gt;2019/9/8&lt;/td&gt;
              &lt;td&gt; Designer&lt;/td&gt;
             &lt;/tr&gt;                
      &lt;/table&gt;
        &lt;asp:GridView ID=&quot;GridView1&quot; runat=&quot;server&quot; AutoGenerateColumns=&quot;False&quot; AllowPaging=&quot;True&quot; PageSize=&quot;3&quot; OnDataBound=&quot;GridView1_DataBound&quot; OnPageIndexChanging=&quot;GridView1_PageIndexChanging&quot; ShowHeader=&quot;False&quot; &gt;
            &lt;Columns&gt;
                &lt;asp:BoundField DataField=&quot;title&quot;  &gt;
                &lt;/asp:BoundField&gt;
                &lt;asp:BoundField DataField=&quot;time&quot; &gt;
                &lt;/asp:BoundField&gt;
                &lt;asp:BoundField DataField=&quot;edi&quot; &gt;
                &lt;/asp:BoundField&gt;
            &lt;/Columns&gt;
           &lt;PagerTemplate&gt;
      &lt;table&gt;
          &lt;tr&gt;
              &lt;td&gt;
                          &lt;asp:LinkButton ID=&quot;btnFirst&quot; runat=&quot;server&quot; CausesValidation=&quot;False&quot; CommandArgument=&quot;First&quot; CommandName=&quot;Page&quot; Text=&quot;first&quot;&gt;&lt;/asp:LinkButton&gt;&amp;nbsp;&amp;nbsp;
                          &lt;asp:LinkButton ID=&quot;btnPrev&quot; runat=&quot;server&quot; CausesValidation=&quot;False&quot; CommandArgument=&quot;Prev&quot; CommandName=&quot;Page&quot; Text=&quot;pre&quot;&gt;&lt;/asp:LinkButton&gt;&amp;nbsp;&amp;nbsp;
                          &lt;asp:LinkButton ID=&quot;btnNext&quot; runat=&quot;server&quot; CausesValidation=&quot;False&quot; CommandArgument=&quot;Next&quot; CommandName=&quot;Page&quot; Text=&quot;next&quot;&gt;&lt;/asp:LinkButton&gt;&amp;nbsp;&amp;nbsp;
                          &lt;asp:LinkButton ID=&quot;btnLast&quot; runat=&quot;server&quot; CausesValidation=&quot;False&quot; CommandArgument=&quot;Last&quot; CommandName=&quot;Page&quot; Text=&quot;last&quot;&gt;&lt;/asp:LinkButton&gt;&amp;nbsp;&amp;nbsp;
                          &lt;asp:DropDownList ID=&quot;DropDownList1&quot; AutoPostBack=&quot;True&quot; OnSelectedIndexChanged=&quot;DropDownList1_SelectedIndexChanged&quot;  runat=&quot;server&quot;&gt;&lt;/asp:DropDownList&gt;
              &lt;/td&gt;
          &lt;/tr&gt;
      &lt;/table&gt;
  &lt;/PagerTemplate&gt;&lt;/asp:GridView&gt;
  </code></pre>
  <p>I have a <code>gridview</code> which get the data from <code>table tab</code> in same web page.
  I using the <code>dataset</code> to get data in table then using databinding let gridview binding the datatable.
  But I when I add <code>dropdownlist</code> in <code>gridview</code> in order to do page changing ,the <code>dropdownlist</code> can't change page,it will stuck in the same page .The linkbutton can work for change page.
  But clicking <code>dropdownlist's listitem</code> can't change to selected pageindex. What should I fix it?</p>
  <pre><code>DataSet ds = new DataSet();
  System.Data.DataTable dt1 = null;
  System.Data.DataRow dr;
  DropDownList DDL = null;
  GridViewRow pagerRow = null;
  
      protected void Page_Load(object sender, EventArgs e)
      {
  
          System.Web.UI.HtmlControls.HtmlTable table = ((System.Web.UI.HtmlControls.HtmlTable)Master.FindControl(&quot;content_holder&quot;).FindControl(&quot;tab&quot;));
          dt1 = new System.Data.DataTable();
          dt1.Columns.Add(&quot;title&quot;, typeof(String));
          dt1.Columns.Add(&quot;time&quot;, typeof(String));
          dt1.Columns.Add(&quot;edi&quot;, typeof(String));
          for (int i = 0; i &lt; table.Rows.Count; i++)
          {
              dr = dt1.NewRow();
              dr[&quot;title&quot;] = table.Rows[i].Cells[0].InnerText;
              dr[&quot;time&quot;] = table.Rows[i].Cells[1].InnerText;
              String edi = table.Rows[i].Cells[2].InnerText.Trim();
              dr[&quot;edi&quot;] = edi;
              dt1.Rows.Add(dr);  
          }
  
          GridView1.DataSource = dt1; 
          GridView1.DataBind();  
      }
  
  
      protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
      {
          if (e.NewPageIndex &lt; 0) {
              GridView1.PageIndex = 0;
          }
          else
          {
              GridView1.PageIndex = e.NewPageIndex;
          }
          GridView1.DataBind();
      }
  
  
  
      protected void GridView1_DataBound(object sender, EventArgs e)
      {
  
  
  
              pagerRow = GridView1.BottomPagerRow;
              DDL = (DropDownList)pagerRow.FindControl(&quot;DropDownList1&quot;);
              for (int i = 0; i &lt; GridView1.PageCount; i++)
              {
                  int pageNumber = i + 1;
                  ListItem item = new ListItem(pageNumber.ToString());
                  if (i == GridView1.PageIndex) {
                      item.Selected = true;
                  }
                  DDL.Items.Add(item);
              }
             
          
      }
  
      protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
      {
          pagerRow = GridView1.BottomPagerRow;
          DDL = (DropDownList)pagerRow.FindControl(&quot;DropDownList1&quot;);
          GridView1.PageIndex = DDL.SelectedIndex;
      }
  </code></pre>