title: call listview OnPagePropertiesChanging function from another function in c# asp.net
body: <p>I have an aspx ListView control, a data pager for paging, paging is working fine. Now I have a dropdown to change page size and show the relevant records in listview. But dropdown not working properly.</p>
  
  <p>I have total 14 records and when i go to 2nd page which has 4 records after that i change dropdown page size to 30 then it does not reflect listview and still showing same 4 records. It changes page number from 2nd to 1st only.</p>
  
  <p><strong>HTML:-</strong> </p>
  
  <pre><code>&lt;asp:DropDownList  ID="ddlCount" AutoPostBack="true" runat="server" CssClass="form-control" 
  SelectedIndexChanged="ddlCount_SelectedIndexChanged"&gt;                 &lt;/asp:DropDownList&gt;
  
           &lt;asp:ListView ID="lvParkingLots" runat="server" GroupPlaceholderID="grp" ItemPlaceholderID="item"
                                                  GroupItemCount="2" OnPagePropertiesChanging="lvPL_PagePropertiesChanging"&gt;
                                                  &lt;LayoutTemplate&gt;
                                                      &lt;table class="table table-striped tblForm" id="gs"&gt;
                                                          &lt;tr id="grp" runat="server"&gt;
                                                          &lt;/tr&gt;
                                                          &lt;tr class="pagination-listview"&gt;
                                                              &lt;td&gt;&lt;/td&gt;
                                                              &lt;td style="float: right;"&gt;
                                                                  &lt;asp:DataPager ID="dp" runat="server" PagedControlID="lvParkingLots" PageSize="30"&gt;
                                                                      &lt;Fields&gt;
                                                                          &lt;asp:NumericPagerField NextPageText="Next" PreviousPageText="Prev" /&gt;
                                                                      &lt;/Fields&gt;
                                                                  &lt;/asp:DataPager&gt;
  
                                                              &lt;/td&gt;
                                                          &lt;/tr&gt;
                                                      &lt;/table&gt;
                                                  &lt;/LayoutTemplate&gt;
  </code></pre>
  
  <p><strong>C# function:-</strong></p>
  
  <pre><code> protected void lvPL_PagePropertiesChanging(object sender, PagePropertiesChangingEventArgs e)
      {          
              DataPager dp = (lvParkingLots.FindControl("dp") as DataPager);            
              dp.SetPageProperties(e.StartRowIndex, e.MaximumRows, false);
              Binddata();            
      }
  </code></pre>
  
  <p><strong>I have tried below code but not working..</strong></p>
  
  <pre><code> protected void ddlCount_SelectedIndexChanged(object sender, EventArgs e)
   {
        Binddata(); 
   }
  </code></pre>