|
板凳
楼主 |
发表于 2017-5-14 10:17:21
|
只看该作者
下面是我绑定数据的
private void BindGrid(FineUIMvc.Grid Grid1,string LH)
{
int iPageIndex = Grid1.PageIndex + 1;
int iPageSize = Grid1.PageSize;
string WhereStr = "1=1";
string[] aryKey = new string[4];
aryKey[0] = LH; // txtLH.Text;
DataTable dt = QueryCommon.GetQueryResult("WSP_ERPITEM_LIST", "list", iPageIndex, iPageSize, WhereStr, aryKey);
//表记录
//Grid1.RecordCount = Convert.ToInt32(QueryCommon.GetQueryResult("WSP_ERPITEM_LIST", "count", 1, 99999, WhereStr, aryKey).Rows[0][0]);
ViewBag.Grid1RecordCount = Convert.ToInt32(QueryCommon.GetQueryResult("WSP_ERPITEM_LIST", "count", 1, 99999, WhereStr, aryKey).Rows[0][0]);
//表内容
//Grid1.DataSource = dt;
ViewBag.Data = null;
ViewBag.Grid1DataSource = dt;
Grid1.DataBind();
}
在加载时调用,在翻页时会调用
[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult Grid1_PageIndexChanged(FineUIMvc.Grid Grid1, string Grid1_pageIndex)
{
Grid1.PageIndex = Convert.ToInt32(Grid1_pageIndex);
BindGrid(Grid1, string.Empty);
return UIHelper.Result();
}
我断点看了,在ViewBag.Grid1DataSource = dt;时数据是正确的,但是接下来的显示就不多了 |
|