请教有关DATAGRID的问题 我想可以自己控制,点下一页的时候就把下若干条数据提取出来显示到datagrid里面. 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 写一个数据绑定的方法,负责获取数据到DataSet并往DataGrid中绑定:private void BindData(){ //数据绑定}在Page_Load中... if( !IsPostBack ) { BindData(); }...响应DataGrid的PageIndexChange事件,或直接在InitializeComponent中添加:this.dataGrid1.PageIndexChanged += new System.Web.UI.WebControls.DataGridPageChangedEventHandler(this.dataGrid1_PageIndexChanged);然后在DataGrid的PageIndexChange事件代码中:private void dataGrid1_PageIndexChanged(object source, System.Web.UI.WebControls.DataGridPageChangedEventArgs e){ dataGrid1.CurrentPageIndex = e.NewPageIndex; BindData(); //重新绑定数据} dgcust.CurrentPageIndex = e.NewPageIndex;DataGridBind(this.GetDataView(sqlstr));this.documentMultiPage.Visible=false; 继续请教,如何直接向服务器提交信息 新建一form作为浮动窗口(鹰眼),如何关联主程序和此窗口 [No relevant source lines]是什么问题 我的C1FlexGrd 控件为什么看不到设计器? 微软 logical thinking 面试题目 求助动态打开窗口实例的问题,在线等待!!! 点击按钮新建窗体后,如何设置它里面的值 请问在c#中如何使用这两个api函数 Timer的Elapsed中抛出异常,谁来接? 关于窗体显示问题 请教一个简单的问题? 急,为什么会出现这样的资源异常?50分相送!
private void BindData()
{
//数据绑定
}
在Page_Load中
...
if( !IsPostBack )
{
BindData();
}
...响应DataGrid的PageIndexChange事件,或直接在InitializeComponent中添加:
this.dataGrid1.PageIndexChanged += new System.Web.UI.WebControls.DataGridPageChangedEventHandler(this.dataGrid1_PageIndexChanged);然后在DataGrid的PageIndexChange事件代码中:
private void dataGrid1_PageIndexChanged(object source, System.Web.UI.WebControls.DataGridPageChangedEventArgs e)
{
dataGrid1.CurrentPageIndex = e.NewPageIndex;
BindData(); //重新绑定数据
}
DataGridBind(this.GetDataView(sqlstr));
this.documentMultiPage.Visible=false;