datagrid专栏1(分页)
来源:互联网 发布:java classpath linux 编辑:程序博客网 时间:2024/06/05 03:54
void BindGrid()
{
string bclassId = this.ddlClass.SelectedValue;
BLL.Product product = new admin.BLL.Product();
DataSet ds = new DataSet();
ds = product.GetProductList1(bclassId);
this.DataGrid1.AllowPaging = true;
this.DataGrid1.DataSource = ds.Tables[0].DefaultView;
this.DataGrid1.DataBind();
this.DataGrid1.DataKeyField = "ProductId";
this.ShowState();
}
void ShowState()
{
this.lblCurrPage.Text = "第"+Convert.ToString(this.DataGrid1.CurrentPageIndex+1)+"页";
this.lblPageCount.Text = "共"+this.DataGrid1.PageCount+"页";
}
public void PageButtonClick(object sender, System.EventArgs e)
{
string arg = ((LinkButton)sender).CommandName.ToString();
switch(arg)
{
case "next":
if(this.DataGrid1.CurrentPageIndex<this.DataGrid1.PageCount-1)
{
this.DataGrid1.CurrentPageIndex +=1;
}
break;
case "prior":
if(this.DataGrid1.CurrentPageIndex>0)
{
this.DataGrid1.CurrentPageIndex -=1;
}
break;
case "last":
this.DataGrid1.CurrentPageIndex = this.DataGrid1.PageCount-1;
break;
default:
this.DataGrid1.CurrentPageIndex = 0;
break;
}
this.BindGrid();
this.ShowState();
}
- datagrid专栏1(分页)
- DataGrid 专栏
- DataGrid 专栏
- 一个功能齐全的DataGrid分页例子 -------------bluemoon213的专栏
- datagrid专栏2
- 转载: 愚翁专栏 探讨DataGrid的几种分页方法的优劣
- DataGrid控件(二)--分页
- DataGrid控件(二)--分页
- DataGrid自定义分页(C#)
- flex DataGrid分页(demo)
- 每天学一点Flex(1):DataGrid组件分页
- [转载]每天学一点Flex(1):DataGrid组件分页
- datagrid分页
- DataGrid分页
- datagrid分页
- DataGrid分页
- Datagrid分页
- DataGrid 分页
- CreateFont()函数的MSDN翻译
- 真的很忙
- Forms的角色验证授权
- 开始了解Java
- .NET常用功能和代码
- datagrid专栏1(分页)
- 为WINDOWS XP减肥
- asp.net生成缩略图及给原始图加水印
- 《大道至简》的幕后故事(4):“愚公移山记”军事地理篇
- datagrid专栏2
- 用SQLDMO在ASP.NET页面下实现数据库的备份与恢复
- asp.net在线备份SQL Server数据库
- 回答看完《心情随笔》的朋友最关心的问题。
- Prototype 1.5 Ajax 使用教程