c# winform 怎么使用DataGridView 的垂直滚动条实现不同条件的分页效果
我现在放置了三个Button 我现在想让DatagridView的垂直滚动条实现在点击不同按钮后对点击的那个Button 条件读出来的数据进行分页,请问高手怎么实现? 谢谢了啊!
SqlConnection con = new SqlConnection(GZSoft.Web.GZBasic.GetWebConfigString("GZSoftConn"));
string sql = "1=1 ";
if (SQLStr.Trim() != "")
{
sql += SQLStr;
}
SqlDataAdapter dr = new SqlDataAdapter("select * from Basic_View_115Apply where " + sql + " order by " + ddlCompositor.SelectedValue+" "+ddlorderBy.SelectedValue, con);
DataSet ds = new DataSet();
DataSet ds2 = new DataSet();
dr.Fill(ds2);
dr.Fill(ds, 1, 15, "tab1");//前15条
this.gvTab.DataSource = ds.Tables[0];
this.gvTab.DataBind();