怎么求gridview 的记录条数?(在分页的情况下和有DropDownList控制的情况下!!)
publicvoidbind(){if(DropDownList1.SelectedIndex==1){//GridView1.AllowPaging=false;//i...
public void bind()
{
if (DropDownList1.SelectedIndex == 1)
{
//GridView1.AllowPaging = false;
//int count = GridView1.Rows.Count;
//Label3.Text = count.ToString();
//GridView1.AllowPaging = true;
GVBind("select * from CP "); }
else
{
string OleDbStr = "select * from CP where Dstyle='" + DropDownList1.SelectedValue.ToString() + "'";
GVBind(OleDbStr);
int count = GridView1.Rows.Count;
Label3.Text = count.ToString();
}
}
我试过用先关闭分页,不过不行!!也可能是我写错了) 展开
{
if (DropDownList1.SelectedIndex == 1)
{
//GridView1.AllowPaging = false;
//int count = GridView1.Rows.Count;
//Label3.Text = count.ToString();
//GridView1.AllowPaging = true;
GVBind("select * from CP "); }
else
{
string OleDbStr = "select * from CP where Dstyle='" + DropDownList1.SelectedValue.ToString() + "'";
GVBind(OleDbStr);
int count = GridView1.Rows.Count;
Label3.Text = count.ToString();
}
}
我试过用先关闭分页,不过不行!!也可能是我写错了) 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询