关于使用datagrid的两个问题,help...

beansprout beansprout 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
private void BindGrid()
{
this.myconn.FillDataSet(titleDataSet1);
this.DataGrid1.DataBind();
}
private void Page_Load(object sender, System.EventArgs e)
{
if(this.IsPostBack)
return;
BindGrid();
}
private void Button1_Click(object sender, System.EventArgs e)
{
this.DataGrid1.CurrentPageIndex=0;
this.myconn.SqlDataAdapter1.SelectCommand.CommandText="select * from title_gov where "+ddlsearchclass.SelectedValue+" like '%"+tbsearchkey.Text+"%'";
BindGrid();
}
private void DataGrid1_PageIndexChanged(object source, System.Web.UI.WebControls.DataGridPageChangedEventArgs e)
{
this.DataGrid1.CurrentPageIndex=e.NewPageIndex;
BindGrid();
}
我点击按钮button1的时候 DataGrid1显示出要查询的内容,DataGrid1将查询的记录分为4页,,当我点击第2页的时候,却跑到Page_Load时的第2页去了,怎么解决啊?help。。。
还有我怎么定义DataGrid1的行距啊?help。。
...全文

相关推荐

评论 22
收藏 已收藏
分享
返回顶部
beansprout
.NET社区 62,271 成员 668,968 内容