DEV结束表格编辑获取选中的数据

//结束表格编辑,过滤出选中的数据,用于读取
        public static DataTable GetSelectDataForRead(GridView gvMaster, DataView dvMaster, string RowFilter)
        {
            if (null == gvMaster || null == dvMaster)
            {
                return null;
            }
            gvMaster.CloseEditor();
            gvMaster.UpdateCurrentRow();

            DataTable dtData = dvMaster.ToTable();
            dtData.DefaultView.RowFilter = RowFilter; // "Flag = 1";
            dtData = dtData.DefaultView.ToTable(); //只留下已经选中的单据
            return dtData;
        }

相关推荐