FineUI 官方论坛

标题: 表格数据没有显示出来?? [打印本页]

作者: yygy    时间: 2017-8-7 21:26
标题: 表格数据没有显示出来??
本帖最后由 yygy 于 2017-8-7 21:29 编辑

在视图中
.DataSource(ViewBag.Grid1DataSource)

在控制器中
        public ActionResult Index()
           {
                LoadData();
                return View();
            }

        private void LoadData()
        {
            var s = "select * from ypt";
            ViewBag.Grid1DataSource = Cpmro.DBL.SqlHelper.getData(s);
        }

这样可以显示数据出来,但按键单击数据就没有显示出来                 public ActionResult Index()
           {
           //     LoadData();
                return View();
            }

        [HttpPost]
        [ValidateAntiForgeryToken]
        public ActionResult Button1_Click()
        {
            LoadData();
            return UIHelper.Result();
        }

是否有哪里错了????



作者: yygy    时间: 2017-8-8 14:37
应该是这个:UIHelper.Grid("Grid1").DataSource(source, Grid1_fields);




欢迎光临 FineUI 官方论坛 (https://www.fineui.com/bbs/) Powered by Discuz! X3.4