| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- /*******************************************************************************
- * Copyright(c) 2014 DongkeSoft All rights reserved. / Confidential
- * 类的信息:
- * 1.程序名称:DKDataGridView.cs
- * 2.功能描述:扩展的网格控件:便于修改背景颜色及字体、颜色
- * 编辑履历:
- * 作者 日期 版本 修改内容
- * 陈晓野 2014/08/13 1.00 新建
- *******************************************************************************/
- using System.Collections.Generic;
- using System.Windows.Forms;
- namespace Dongke.IBOSS.PRD.Basics.BaseControls
- {
- /// <summary>
- /// 扩展的网格控件
- /// </summary>
- public abstract partial class DKDataGridView : DataGridView, IDKControl
- {
- #region 成员变量
- // 异步处理开始时,控件状态
- private bool _beginAsyncStatus;
- //private Dictionary<DataGridViewColumn, bool> _beginAsyncColumnStatus;
- #endregion
- #region 控件构造函数
- public DKDataGridView()
- {
- InitializeComponent();
- this.Font = ControlsConst.FONT_SYSTEM_DEFAULT;
- }
- #endregion
- #region 控件属性
- #endregion
- #region 公有方法
- /// <summary>
- /// 异步处理开始
- /// </summary>
- public void BeginAsync()
- {
- //if (_beginAsyncColumnStatus == null)
- //{
- // _beginAsyncColumnStatus = new Dictionary<DataGridViewColumn, bool>();
- //}
- //if (_beginAsyncColumnStatus.Count > 0)
- //{
- // return;
- //}
- //foreach (DataGridViewColumn item in this.Columns)
- //{
- // _beginAsyncColumnStatus.Add(item, item.ReadOnly);
- // item.ReadOnly = true;
- //}
- //this._beginAsyncStatus = this.ReadOnly;
- //this.ReadOnly = true;
- this._beginAsyncStatus = this.Enabled;
- this.Enabled = false;
- }
- /// <summary>
- /// 异步处理结束
- /// </summary>
- public void EndAsync()
- {
- //this.ReadOnly = this._beginAsyncStatus;
- //foreach (DataGridViewColumn item in _beginAsyncColumnStatus.Keys)
- //{
- // item.ReadOnly = _beginAsyncColumnStatus[item];
- //}
- //_beginAsyncColumnStatus.Clear();
- this.Enabled = this._beginAsyncStatus;
- }
- #endregion
- }
- }
|