首先用toolstrip控件建立一个分页用的按钮,如下图 代码: Code 1private DataTable GetDicData()//获取所有据 2 { 3 BLLB_CommunitDIC bcdicBll = new BLLB_CommunitDIC(); 4 if (trvDic.SelectedNode != null) 5 { 6 if (trvDic.SelectedNode.Parent == null) 7 { 8 return null; 9 } 10 else 11 { 12 int areaid = Convert.ToInt32(trvDic.SelectedNode.Tag); 13 14 return FCT.Common.PublicMethods.ConvertToDataSet(bcdicBll.GetAll(areaid)).Tables[0]; 15 } 16 } 17 else 18 return null; 19 } 20//根据页索此获取数据 21 private void InitData(int pageindex) 22 { 23 DataTable dt = GetDicData(); 24 string msg; 25 if (dt != null &