当用到DevExpress中的DevExpress.XtraGrid.Columns.GridColumn列时,会根据数据来设置其属性。

列的读写属性可见:http://hi.baidu.com/cegqqmfzptacexe/item/71ad1f30f430de9bb80c031b

代码如下:

  DDataGridView dataGridView;
DevExpress.XtraGrid.Columns.GridColumn colSensorName = new DevExpress.XtraGrid.Columns.GridColumn();
            colSensorName.Caption = "测点名称"; 
            colSensorName.FieldName = "SensorName";
            colSensorName.VisibleIndex = 2; 
           colSensorName.Width = 100;//
            colSensor_ID.OptionsColumn.FixedWidth = true;
            colSensorName.OptionsColumn.AllowEdit = false;//设置只读
            dataGridView.Columns.Add(colSensorName);

 在编程的过程中,只有不断的尝试才能达到最佳的效果,这就是开发……

相关文章:

  • 2022-02-06
  • 2021-05-24
  • 2022-03-02
  • 2022-12-23
  • 2022-12-23
  • 2021-06-22
  • 2021-10-10
  • 2021-08-05
猜你喜欢
  • 2021-11-02
  • 2022-12-23
  • 2021-11-25
  • 2021-11-26
  • 2021-11-28
  • 2021-09-03
  • 2021-08-12
相关资源
相似解决方案