datagrid数据表能分页,但是点击导航栏不能翻页,没反应,而且导航栏的数字1不能点击,我用的是datagrid的自动分页方式,代码如下:
public void datagridBak_PageIndexChanged(object source, System.Web.UI.WebControls.DataGridPageChangedEventArgs e)//分页代码
{
datagridBak.CurrentPageIndex=e.NewPageIndex;
DGBind();
}
private void DGBind()//绑定数据源
{
SqlConnection myConnection=new SqlConnection(common_cs.database.connectionstr);
myConnection.Open();
string strjs="select * from SJB";
SqlDataAdapter myDataAdapter=new SqlDataAdapter(strjs,myConnection);
DataSet myds=new DataSet();
myDataAdapter.Fill(myds,"SJB");
datagridBak.DataSource=myds.Tables["SJB"].DefaultView;
datagridBak.DataBind();
myConnection.Close();
}
为什么啊??
谢谢