Click here to Skip to main content
15,891,253 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
paging in gridview not working for first click ..pls help me


thanks in advance
Posted

>onpageindexchanging="GridView1_PageIndexChanging"

AllowPaging="True"

write below code page index changing event

C#
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();
 
Share this answer
 
v2
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 .
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900