(1) //c1TrueDBGrid 设置某列的是否显示
this.c1TrueDBGrid1.Splits[0].DisplayColumns["fieldName"].Visible = false;
(2) //c1TrueDBGrid 获得目前行数
int rows = this.c1TrueDBGrid2.Splits[0].Rows.Count;
(3)//c1TrueDBGrid 合计的做法
.写在load事件里的代码
int rows = this.c1TrueDBGrid1.Splits[0].Rows.Count;
int sum1 = 0;
for (int i = 0; i < rows; i++)
{
string unit1 = this.c1TrueDBGrid1[i, "aa"].ToString();
sum1 += Convert.ToInt32(unit1);
}
this.c1TrueDBGrid1.Columns["aa"].FooterText = sum1.ToString();
.c1TrueDBGrid1属性ColumnFooters设置为true
或者在load中加上 c1TrueDBGrid1.ColumnFooters = true;(截止)
(4) /// c1TrueDBGrid /设置某一列的背景颜色
this.c1TrueDBGrid1.Splits[0].DisplayColumns["bb"].Style.BackColor = System.Drawing.Color.Blue;
(5) // c1TrueDBGrid 设置某一列不允许取得焦点
this.c1TrueDBGrid1.Splits[0].DisplayColumns["bb"].AllowFocus = false;
(6) // c1TrueDBGrid 设置某一列不不能编辑
this.c1TrueDBGrid1.Splits[0].DisplayColumns["bb"].Locked = true;
(7) //c1TrueDBGrid 某一列的宽度设置为自适应宽度
this.c1TrueDBGrid1.Splits[0].DisplayColumns["aa"].AutoSize();
(8) //c1TrueDBGrid 冻结某一列
this.c1TrueDBGrid1.Splits[0].DisplayColumns["aa"].Frozen = true;