zoukankan      html  css  js  c++  java
  • 设定DGV都可以编辑(封装DGv)设定控件ReadOnly和列ReadOnly都为false即可

    dgvTimesInfo.ReadOnly = false;
    List<Ctrls.Grid.GridColumn> columns = new List<Ctrls.Grid.GridColumn>();
                columns.Add(new Ctrls.Grid.GridColumn() { Caption = $"时段", Field = nameof(TimesInfo.TimeInterval), DataType = typeof(string), Visible = true, Width = 100 });
                columns.Add(new Ctrls.Grid.GridColumn() { Caption = $"{GetThisWeekMonday(System.DayOfWeek.Monday)}
     周一", Field = nameof(TimesInfo.Monday), DataType = typeof(bool), Visible = true, Width = 100,ReadOnly=false });
                columns.Add(new Ctrls.Grid.GridColumn() { Caption = $"{GetThisWeekMonday(System.DayOfWeek.Tuesday)}
     周二", Field = nameof(TimesInfo.Tuesday), DataType = typeof(bool), Visible = true, Width = 100, ReadOnly = false });
                columns.Add(new Ctrls.Grid.GridColumn() { Caption = $"{GetThisWeekMonday(System.DayOfWeek.Wednesday)}
     周三", Field = nameof(TimesInfo.Wednesday), DataType = typeof(bool), Visible = true, Width = 100, ReadOnly = false });
                columns.Add(new Ctrls.Grid.GridColumn() { Caption = $"{GetThisWeekMonday(System.DayOfWeek.Thursday)}
     周四", Field = nameof(TimesInfo.Thursday), DataType = typeof(bool), Visible = true, Width = 100, ReadOnly = false });
                columns.Add(new Ctrls.Grid.GridColumn() { Caption = $"{GetThisWeekMonday(System.DayOfWeek.Friday)}
     周五", Field = nameof(TimesInfo.Friday), DataType = typeof(bool), Visible = true, Width = 100, ReadOnly = false });
                columns.Add(new Ctrls.Grid.GridColumn() { Caption = $"{GetThisWeekMonday(System.DayOfWeek.Saturday)}
     周六", Field = nameof(TimesInfo.Saturday), DataType = typeof(bool), Visible = true, Width = 100, ReadOnly = false });
                columns.Add(new Ctrls.Grid.GridColumn() { Caption = $"{GetThisWeekMonday(System.DayOfWeek.Sunday)}
     周日", Field = nameof(TimesInfo.Sunday), DataType = typeof(bool), Visible = true, Width = 100, ReadOnly = false });
                dgvTimesInfo.InitColumns(columns);
  • 相关阅读:
    luogu P3238 [HNOI2014]道路堵塞
    luogu P3235 [HNOI2014]江南乐
    luogu P3237 [HNOI2014]米特运输
    luogu P3233 [HNOI2014]世界树
    luogu P3234 [HNOI2014]抄卡组
    luogu P3250 [HNOI2016]网络
    luogu P3201 [HNOI2009]梦幻布丁
    luogu P4148 简单题
    luogu P3767 膜法
    luogu P4314 CPU监控
  • 原文地址:https://www.cnblogs.com/yuanshuo/p/14512307.html
Copyright © 2011-2022 走看看