序号 功能 常用代码

1

支持多选 this.GridView1.OptionsSelection.MultiSelect = true;

2

显示滚动条 this.GridView1.OptionsView.ColumnAutoWidth = false;
3 显示统计信息

this.GridView1.OptionsView.ShowFooter = true;
this.gridColumn1.Summary.AddRange(new DevExpress.XtraGrid.GridSummaryItem[] {
new DevExpress.XtraGrid.GridColumnSummaryItem(DevExpress.Data.SummaryItemType.Count, "FieldName", "总计: {0}")});

4 是否允许编辑 this.gridColumn1.OptionsColumn.AllowEdit = false;
5 允许选择单个单元格,并拷贝单元格的值

this.GridView1.OptionsSelection.MultiSelectMode = DevExpress.XtraGrid.Views.Grid.GridMultiSelectMode.CellSelect;

this.gvShopeeSellingData.OptionsBehavior.CopyToClipboardWithColumnHeaders = false;

6 修改特定列的背景色 this.gridColumn1.AppearanceCell.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(128)))));
7 修改选中行的颜色 this.gvShopeeItemOperationData.Appearance.SelectedRow.BackColor = System.Drawing.SystemColors.MenuBar;
8 checkbox 需要双击才能选中?No

1. 设置checkbox列为Selected。绑定的数据源中返回(0  as Selected)

2. 设置RowCellClick 设置对应的单元格的值为0/1 

gv.SetFocusedRowCellValue(e.Column, values);

3. 进入“In-place Editor Repository” ,修改对应的控件的Valuechecked为1,ValueUnchecked为0

posted on 2017-12-30 11:49  timy  阅读(273)  评论(0编辑  收藏  举报