• C# 整理DotNetBar中SuperGridControl的一些基础属性


    //控制表格只能选中单行

    superGridControl1.PrimaryGrid.MultiSelect = false;

    superGridControl1.PrimaryGrid.InitialSelection = RelativeSelection.Row;

    //只能选中一个单元格,而不是一行单元格

    superGridControl1.PrimaryGrid.SelectionGranularity =SelectionGranularity.Row;

    值得一提的是,如果出不来效果,查看一下表格的属性

    将Selection Granularity属性改为Row

    //是否显示序列号

    superGridControl1.PrimaryGrid.ShowRowHeaders = false;

    //自动填满表格

    superGridControl1.PrimaryGrid.ColumnAutoSizeMode = ColumnAutoSizeMode.Fill;

    //允许单元格拖动成为集合组

    superGridControl1.PrimaryGrid.ColumnHeader.AllowSelection = true;

    superGridControl1.PrimaryGrid.GroupByRow.Visible = false;

    GridPanel panel = superGridControl1.PrimaryGrid;

     

    //设置表格自动展开

    panel.AutoExpandSetGroup = true;

    panel.SetGroup(panel.Columns["列名"]);

    //设置表格中文字的位置居中     

    superGridControl1.PrimaryGrid.DefaultVisualStyles.CellStyles.Default.Alignment= DevComponents.DotNetBar.SuperGrid.Style.Alignment.MiddleCenter;

     

    //获取单元格的值

    SelectedElementCollection col=this.superGridControl1.PrimaryGrid.GetSelectedRows();

    List<GridCell> cells = col.GetCells();

    textBoxX1.Text = cells[2].Value.ToString();

     

  • 相关阅读:
    MobileNet V1 V2
    异常检测 与 One Class SVM
    异常检测
    图像分割
    1x1卷积核的作用
    迁移学习
    python
    图像分割
    图像分割
    Nagios
  • 原文地址:https://www.cnblogs.com/Liu30/p/6830417.html
Copyright © 2020-2023  润新知