title: Gridview custom paging inside wizard control doesn't work correct in asp.net
body: <p>I have a page where guests can be selected. </p>
  
  <p>This page contains an update panel, within the update panel there is a wizard control and in the wizard control there is a gridview (Panel-> Update Panel -> wizard control -> gridview)</p>
  
  <p>Now the paging doesn't work well, I searched the internet for answers but I didn't find the right answer. I use custom paging.</p>
  
  <p>When I want to change the pagenumber (to the second or last page) it works fine. But when I want to select a row or go to another page, the gridview doesn't work correct. When I select A row on the second or last page (other page's don't work) the selected guest (item) is always one of the first page. When I want change to another page (from the second or last page) it doesn't work and stays on the selected page.</p>
  
  <p>Is there a way to solve this problem?</p>
  
  <p>part of the code:</p>
  
  <pre><code>               &lt;asp:Panel ID="PnlRe" Style="display: none; ... &gt;
      &lt;asp:UpdatePanel ID="UpdtPnlDetail" runat="server" UpdateMode="Conditional"&gt;
          &lt;ContentTemplate&gt;
          ...
          &lt;asp:Wizard ID="wzd" runat="server" ... &gt;
              ...
              &lt;asp:WizardStep ID="WizardStep3" runat="server" Title="Naam"&gt;
                          ...
                             &lt;asp:Gridview ID="Gridview1" runat="server" AutoGenerateColumns="False"
                                 DataKeyNames="GastID,Versie" DataSourceID="odsGasten" EmptyDataText="...."
                                 OnRowCommand="Gridview1_RowCommand" OnPageIndexChanging="Gridview1_PageIndexChanging"
                                 OnPageSizeChanging="Gridview1_PageSizeChanging" OnSearching="Gridview1_Searching"
                                 OnSorting="Gridview1_Sorting" OnRowDataBound="Gridview1_RowDataBound"
                                 CausesValidation="False" meta:resourcekey="..." PagerType="Custom"
                                 ShowFilter="True" ShowInsertRecord="True" ShowPageSizer="True" UseSubmitBehaviour="False"&gt;
                                 &lt;Columns&gt;
                                     &lt;asp:TemplateField ShowHeader="False" meta:resourcekey="..."&gt;
                                         &lt;ItemTemplate&gt;
                                             &lt;asp:ImageButton runat="server" CommandName="Select" CausesValidation="False" SkinID="uprowbutton"
                                                 ToolTip="..." ID="ImgBtnSelect" meta:resourcekey="..."&gt;
                                             &lt;/asp:ImageButton&gt;
                                         &lt;/ItemTemplate&gt;
                                     &lt;/asp:TemplateField&gt;
                                     ... Boundfields ...
                                 &lt;/Columns&gt;
                             &lt;/asp:Gridview&gt;
                          ...
                      &lt;/asp:WizardStep&gt;
                      ... 
      &lt;/asp:Wizard&gt;
      &lt;/ContentTemplate&gt;
  &lt;/asp:UpdatePanel&gt;
  </code></pre>
  
  <p></p>
  
  <pre><code>protected void Gridview1_PageIndexChanging(object sender, GridViewPageEventArgs e)
  {
      this.odsGasten.FilterExpression = searchText;
      this.Gridview1.DataBind();
      this.UpdtPnlDetail.Update();
  }
  </code></pre>