javascript - How to view 2nd page in paging on click numbers in bottom -
i trying search , grids shows me results of 20 records.
if have applied allow paging true , page size 20
then on click on 2nd page in grid whole grid refreshing ans showing me whole grid once again 1st page.
how view last 10 records 11 20 if records 20 , page size 10
client side code of grid
<div id="divapplication" runat="server"> <asp:gridview id="gvapplication" runat="server" autogeneratecolumns="false" allowpaging="true" allowsorting="true" alternatingrowstyle-cssclass="alt" pagerstyle-cssclass="pgr" onpageindexchanging="onpageindexchanging" cssclass="table table-bordered table-striped" pagesize="10" width="50%"> <columns> <asp:templatefield headertext='application' headerstyle-verticalalign="middle"> <headerstyle horizontalalign="center" verticalalign="middle" cssclass="chkbox" /> <itemtemplate> <asp:label id="lblfirstname" runat="server" att='<%#databinder.eval(container.dataitem,"id")%>' text='<%# setlinkcodeapplication(convert.toint64(databinder.eval(container.dataitem,"id")),databinder.eval(container.dataitem,"application").tostring()) %>'></asp:label> </itemtemplate> <itemstyle width="3%" horizontalalign="left" /> </asp:templatefield> </columns> </asp:gridview> </div>
binding grid in c# on server side code
public void fncfillapplication() { try { dataset ds = new dataset(); ds.readxml(server.mappath("application.xml")); if (ds.tables[0].rows.count != 0) { gvapplication.datasource = ds; gvapplication.databind(); } } catch (exception ex) { ex.message.tostring(); } } protected void onpageindexchanging(object sender, gridviewpageeventargs e) { gvapplication.pageindex = e.newpageindex; this.fncfillapplication(); }
setlinkcode binding data in edit mode
public string setlinkcodeapplication(int64 sid, string sname) { string functionreturnvalue = null; try { functionreturnvalue = "<a href=javascript:fncopeneditpopupapplication(" + sid + ")>" + sname.trim() + "</a>"; //return functionreturnvalue; } catch (exception ex) { throw; } return functionreturnvalue; }
i using xml datasource bind data
i think should use
xdocument document = xdocument.load(@"c:\users\administrator\documents\visual studio 2010\projects\linqtoxmlselectapp\linqtoxmlselectapp\employee.xml"); var query = r in document.descendants("employee") (int)r.element("age") > 27 select new { firstname = r.element("firstname").value, age = r.element("age").value }; gridview1.datasource = query; gridview1.databind();
Comments
Post a Comment