DEV GridControl/TreeList 中ShowingEditor使用

版权声明:肥嘟嘟左卫门-694365683@qq.com https://blog.csdn.net/u012235352/article/details/80696819

ShowingEditor事件对我来说就是控制单元格的编辑属性,在特定场景中(TreeList中要求子节点某些列可编辑,父节点不可编辑)就需要使用此事件来实现,与此同时,上一篇也介绍了特定场景单元格样式改变:CustomDrawCell

举个ShowingEitor的使用,

private void treeList1_ShowingEditor(object sender, System.ComponentModel.CancelEventArgs e)
        {
            TreeList currentTreeList = sender as TreeList;
            T row = treeList1.GetDataRecordByNode(currentTreeList.FocusedNode) as T;
            if (currentTreeList != null && row !=null )
            { 
                TreeListColumn column = currentTreeList.FocusedColumn;
                if (column.FieldName == "Qty" || column.FieldName == "Price" || column.FieldName == "Content" || column.FieldName == "Remark" || column.FieldName == "Amount")
                {
                    e.Cancel = (条件)?true:false;
                }
            }
        }

没有更多推荐了,返回首页

私密
私密原因:
请选择设置私密原因
  • 广告
  • 抄袭
  • 版权
  • 政治
  • 色情
  • 无意义
  • 其他
其他原因:
120
出错啦
系统繁忙,请稍后再试