常规总合计直接RunDesigner-Group Summary Items
DisplayFormat 设置显示格式如:{0:P}表示显示为百分号模式。如数据源中为0.5。表示出来为50%
ShowInGroupColumnFooter 在那一列下面显示
SummaryType 合计方式。选择Custom表示自定义。CustomSummaryCalculate事件可处理
Run Designer-Columns列 FormatType="Numeric" FormatString="p"
5、gridView1.OptionsView.ShowGroupPanel = false; 不显示分组面板
6、gridView1.OptionsBehavior.Editable=false; 数据只读
7、设置列时间格式:Formatstring="yyyy-MM-dd HH:ss:mm"; FormatType="Numeric";
设置列数字格式:Formatstring="N2";(数据格式:F表浮点,N表整数,数字表示保留几位小数。N2等同于F2)
9、将所有组展开代码:gridView1.ExpandAllGroups();
10、自动调整所有字段宽度 this.gridView1.BestFitColumns();
调整某列字段宽度 this.gridView1.Columns[n].BestFit();
11、显示滚动条:gridView1.OptionsView.ColumnAutoWidth属性是true,即各列的宽度自动调整,你把它设成false,就会出现了。
12、选择某行后获取当前表格数据 this.textBox1.Text = gridView2.GetDataRow(e.RowHandle)["列名"].ToString();
OptionsView.EnableAppearanceEvenRow =
true;
OptionsView.EnableAppearanceOddRow =
true
;
设置Appearance.EvenRow.BackColor和Appearance.OddRow.BackColor
联系客服