FineUI 官方论坛

标题: Grid 启用单元格编辑 → 动态添加行后 选中的行 定位无效! [打印本页]

作者: 黑夜    时间: 2013-12-26 23:36
标题: Grid 启用单元格编辑 → 动态添加行后 选中的行 定位无效!
本帖最后由 黑夜 于 2013-12-26 23:41 编辑

页面代码
        void Grid1_AfterEdit(object sender, GridAfterEditEventArgs e)
        {
            if(e.RowIndex==Grid1.GetNewAddedList().Count-1)
            {
                JObject defaultObj = new JObject();
                defaultObj.Add("Name", "用户名");
                Grid1.AddNewRecord(defaultObj, true);


                //Grid1.SelectedCell = new int[] {e.RowIndex, 0};
                Grid1.SelectedRowIndex = e.RowIndex-1;   //Note:此行无效果
            }
        }



类.方法
Grid.LoadPostData()

            // 启用单元格编辑
            if (AllowCellEditing)
             {
               ......
              }
            }
            else
            {

                // 选中的行
                int[] selectedRowIndexArray = StringUtil.GetIntListFromString(postCollection[SelectedRowIndexArrayHiddenFieldID], true).ToArray();
                if (!StringUtil.CompareIntArray(SelectedRowIndexArray, selectedRowIndexArray))
                {
                    SelectedRowIndexArray = selectedRowIndexArray;
                    XState.BackupPostDataProperty("SelectedRowIndexArray");
                }

            }

应该从何处修改》?


作者: 黑夜    时间: 2013-12-26 23:39
动态添加行后,数据回发 无记录 当前选中行,总是选中第一行,应该如何处理?
作者: 黑夜    时间: 2013-12-28 13:55
本帖最后由 黑夜 于 2013-12-28 22:06 编辑

FineUI→Grid→RowEditor
期待能优先添加表格控件行编辑事件支持
"beforeedit", "canceledit", "validateedit", "afteredit"
这样一来 FineUI 表格编辑数据 就更得心应手了!
作者: PerfectGo    时间: 2014-11-5 11:14
求解决办法!QQ:1204250774!非常感谢!
作者: sanshi    时间: 2014-11-5 11:48
开源版中,启用单元格编辑后,不能选中行,这个不是问题,详情:

http://fineui.com/bbs/forum.php?mod=viewthread&tid=3029




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