asp.net - save current page of gridview when page dropdownlist selected index change -


i using multi page gridview display bunch of data. here code of gridview.

<asp:gridview id="unverifiedlist" runat="server" autogeneratecolumns="false" allowsorting="true" allowpaging="true"  onrowdatabound="unverifiedlist_rowdatabound" style="font-size:12px" >                         <columns><asp:boundfield headertext="surname" datafield="surname" readonly="true"/></columns>                         <columns><asp:boundfield headertext="firstname" datafield="givenname" readonly="true"/></columns>                        ......                         <columns><asp:templatefield headertext="options" >                                     <itemtemplate>                                         <asp:dropdownlist id="options" runat="server" autopostback="true" onselectedindexchanged="options_selectedindexchanged">                                             <asp:listitem></asp:listitem>                                             <asp:listitem value="1">verified</asp:listitem>                                             <asp:listitem value="2">rejected</asp:listitem>                                         </asp:dropdownlist>                                     </itemtemplate>                                  </asp:templatefield>                                  <asp:templatefield headertext ="reason">                                     <itemtemplate>                                         <asp:textbox id="reason" runat="server" ontextchanged ="reason_textchanged"></asp:textbox>                                     </itemtemplate>                                  </asp:templatefield>                         </columns>                         <pagersettings visible="false"/>                         </asp:gridview>   <asp:dropdownlist id="pageselect" autopostback="true" runat="server" onselectedindexchanged="pageselect_selectedindexchanged"></asp:dropdownlist> 

there column called "option" contains dropdownlist, , postback everytime when selected index changed save edited row. trying avoid frequent postback. think if can save whole page before user turn next page. problem "pageselect" dropdownlist's postback trigger page reload first, onselectedindexchanged event, @ point, gridview turned next page. can give me advice?

you can set enablesortingandpagingcallbacks property of grid view true , wont work if using template fields in gridview, maintaining state of page, have keep value of current page in session , on page load can check session..


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -