在gridview分页不适用于第一次单击..pls帮助我

问题描述:

第一次单击时无法在gridview中分页..pls帮助我


在此先感谢

paging in gridview not working for first click ..pls help me


thanks in advance

> onpageindexchanging ="GridView1_PageIndexChanging"

AllowPaging="True"

在下面编写代码页索引更改事件

>onpageindexchanging="GridView1_PageIndexChanging"

AllowPaging="True"

write below code page index changing event

GridView1.PageIndex = e.NewPageIndex;
        string serchtext = "ClientName like '" + CName + "%' and WorkLocation like '" + Loc + "%' and JobTitle like '" + title + "%'";

        SqlCommand cmdv = new SqlCommand("Select JobId,ClientName,JobTitle,JobType,SkillsRequired,Experience,NoofPositions,Status,WorkLocation from JobsInformation", Con);
        SqlDataAdapter da = new SqlDataAdapter(cmdv);
        DataSet ds = new DataSet();
        da.Fill(ds);
        Con.Close();
        DataView dv = null;
        dv = new DataView(ds.Tables[0]);
        dv.RowFilter = serchtext;
        GridView1.DataSource = ds;
        GridView1.DataBind();


请参阅:

http://forums.asp.net/t/1068982.aspx/1?Gridview + Paging + not + working + on + first + click [
Refer this:

http://forums.asp.net/t/1068982.aspx/1?Gridview+Paging+not+working+on+first+click[^]


^ ]



这是实现的gridview的许多功能,请检查此....
分页和自定义分页代码也可通过示例获取.
http://www.dotnetspider.com/resources/Index.aspx?CategoryId=518&PageNumber=1[^]



Here is lot of functionality of the gridview implemented check this ....
Paging and custom paging code is also available with example .