Exemple #1
0
        /// <summary>
        /// Grid内数据是否改变.
        /// 执行前提是:数据源为一个表,表在操作前事AcceptChange()的
        /// </summary>
        /// <param name="grid"></param>
        /// <returns></returns>
        private bool isChange(EF.EFDevGrid grid)
        {
            grid.MainView.PostEditor();
            grid.RefreshDataSource();
            DataTable table = grid.DataSource as DataTable;

            if (table == null)
            {
                return(false);
            }
            for (int rowIndex = 0; rowIndex < table.Rows.Count; ++rowIndex)
            {
                if (table.Rows[rowIndex].RowState == DataRowState.Deleted || table.Rows[rowIndex].RowState == DataRowState.Added || table.Rows[rowIndex].RowState == DataRowState.Modified)
                {
                    return(true);
                }
            }
            return(false);
        }
Exemple #2
0
 //取消选择所有记录
 private void UnCheckAll(EFDevGrid grid, GridView gridView)
 {
     for (int i = 0; i < gridView.RowCount; i++)
     {
         grid.SetSelectedColumnChecked(i, false);
     }
     gridView.Invalidate();
 }