设置XtraGrid只读,不可编辑

  /// <summary>
        /// 判断是否允许编辑
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void gvRM_IN_YARD_MAIN_ShowingEditor(object sender, CancelEventArgs e)
        {
            DataRow row = this.gvRM_IN_YARD_MAIN.GetDataRow(this.gvRM_IN_YARD_MAIN.FocusedRowHandle);
            if (row != null)
            {
                e.Cancel = true;
                if (gvRM_IN_YARD_MAIN.FocusedColumn.Name == "CHECKED1")
                {
                    e.Cancel = false;
                }
            }
        }

posted @ 2014-03-28 15:30  SharkLock  阅读(6801)  评论(0编辑  收藏  举报