以下代码已经有好多人写过,还望各位多多指教
我只不过是整理了一下在我使用过程中的比较熟悉的,在以后的使用过程中会继续添加
1.gridView 奇行与偶行交替变色
this
.gridView1.OptionsView.EnableAppearanceEvenRow
=
true
;
this .gridView1.OptionsView.EnableAppearanceOddRow = true ;
this .gridView1.Appearance.EvenRow.BackColor = System.Drawing.Color.FromArgb((( int )((( byte )( 255 )))), (( int )((( byte )( 255 )))), (( int )((( byte )( 192 )))));
this .gridView1.Appearance.EvenRow.Options.UseBackColor = true ;
this .gridView1.Appearance.OddRow.BackColor = System.Drawing.Color.FromArgb((( int )((( byte )( 192 )))), (( int )((( byte )( 255 )))), (( int )((( byte )( 255 )))));
this .gridView1.Appearance.OddRow.Options.UseBackColor = true ;
this .gridView1.OptionsView.EnableAppearanceOddRow = true ;
this .gridView1.Appearance.EvenRow.BackColor = System.Drawing.Color.FromArgb((( int )((( byte )( 255 )))), (( int )((( byte )( 255 )))), (( int )((( byte )( 192 )))));
this .gridView1.Appearance.EvenRow.Options.UseBackColor = true ;
this .gridView1.Appearance.OddRow.BackColor = System.Drawing.Color.FromArgb((( int )((( byte )( 192 )))), (( int )((( byte )( 255 )))), (( int )((( byte )( 255 )))));
this .gridView1.Appearance.OddRow.Options.UseBackColor = true ;
2.girdView在第一列显示行号
//
调整第一列的宽度
this
this