• 设置单元格复选框显示值


    1.效果图

    实现代码:

     初始化列代码

     /// <summary>
            /// 初始化时段信息显示列
            /// </summary>
            private void InitColumnTimesInfo()
            {
                List<Ctrls.Grid.GridColumn> columns = new List<Ctrls.Grid.GridColumn>();
                columns.Add(new Ctrls.Grid.GridColumn() { Caption = $"时段", Field = nameof(TimesInfo.VisitingHours), DataType = typeof(string), Visible = true, Width = 40 });
                columns.Add(new Ctrls.Grid.GridColumn() { Caption = $"全选", Field = nameof(TimesInfo.Check), DataType = typeof(bool), Visible = true, Width = 40, ReadOnly = false });
                columns.Add(new Ctrls.Grid.GridColumn() { Caption = $"周一", Field = nameof(TimesInfo.Monday), DataType = typeof(bool), Visible = true, Width = 100, ReadOnly = false });
                columns.Add(new Ctrls.Grid.GridColumn() { Caption = $"周二", Field = nameof(TimesInfo.Tuesday), DataType = typeof(bool), Visible = true, Width = 100, ReadOnly = false });
                columns.Add(new Ctrls.Grid.GridColumn() { Caption = $"周三", Field = nameof(TimesInfo.Wednesday), DataType = typeof(bool), Visible = true, Width = 100, ReadOnly = false });
                columns.Add(new Ctrls.Grid.GridColumn() { Caption = $"周四", Field = nameof(TimesInfo.Thursday), DataType = typeof(bool), Visible = true, Width = 100, ReadOnly = false });
                columns.Add(new Ctrls.Grid.GridColumn() { Caption = $"周五", Field = nameof(TimesInfo.Friday), DataType = typeof(bool), Visible = true, Width = 100, ReadOnly = false });
                columns.Add(new Ctrls.Grid.GridColumn() { Caption = $"周六", Field = nameof(TimesInfo.Saturday), DataType = typeof(bool), Visible = true, Width = 100, ReadOnly = false });
                columns.Add(new Ctrls.Grid.GridColumn() { Caption = $"周日", Field = nameof(TimesInfo.Sunday), DataType = typeof(bool), Visible = true, Width = 100, ReadOnly = false });
                dgvTimesInfo.InitColumns(columns);
            }
  • 相关阅读:
    EZOJ #202
    EZOJ #201
    p5156 [USACO18DEC]Sort It Out
    p4363 [九省联考2018]一双木棋chess
    p2150 [NOI2015]寿司晚宴
    p5155 [USACO18DEC]Balance Beam
    p2414 [NOI2011]阿狸的打字机
    实验室断网的解决方案
    人需要看到未来
    门德尔松--罗辑思维
  • 原文地址:https://www.cnblogs.com/yuanshuo/p/14523378.html
Copyright © 2020-2023  润新知