[求助]datagrid默认分页错误???
我的datagrid中的 PageSize="2" OnPageIndexChanged="datagrid_PageIndexChanged" alowpaging="true"cs里
public void datagrid_PageIndexChanged(object source, System.Web.UI.WebControls.DataGridPageChangedEventArgs e)//分页
{
datagrid.CurrentPageIndex=e.NewPageIndex;
SqlConnection myConnection=new SqlConnection(common_cs.database.connectionstr);
myConnection.Open();
SqlDataAdapter myDataAdapter = new SqlDataAdapter("select * from JSB", myConnection);
DataSet myds = new DataSet();
myDataAdapter.Fill(myds, "JSB");
datagrid.DataSource = myds.Tables["JSB"].DefaultView;
datagrid.DataBind();
现在有4条记录,为什么显示两条记录,但没有分页??谢谢