dxperience7.1.3中的XGridControl使用细节
自己研究的,写下来备忘
XGridControl使用细节
去掉上面的拖拉Group背景
Feature Browser—Grouping—Group panel—ShowGroupPanel=False
更改默认的Group的提示
Feature Browser—Grouping—Group panel—GroupPanelText
进行Group分类后是否还在原来的表格中显示该列
Feature Browser—Grouping—Behavior—ShowGroupedColumns=True or False
分类后是否自动展开所有项目
Feature Browser—Grouping—Behavior—AutoExpandAllGroups
是否允许拖动分类
Feature Browser—Grouping—End User Actions—AllowGroup=True
分类后是否还可以点标题列进行排序
Feature Browser—Grouping—Behavior—KeepGroupExpandedOnSorting
对于在标题列上出现的右键菜单,可以进行禁止
Feature Browser—Grouping—Context Menus—EnableColumnMenu=True Or False
Feature Browser—sorting—Context Menus—EnableColumnMenu=True Or False
一次选中一列并且该行高亮度显示,要多项结合,不能编辑,选择一行而不是一个单元格
Feature Browser—Editing—In Place Editors—Editable=False;
Feature Browser—Editing—Cell Editing—Editable=False;
Feature Browser—Visual Elements—Focus—EnableAppearanceFocusedCell=False
Feature Browser—Visual Elements—Focus—EnableAppearanceFocusedRow=True
Feature Browser—Visual Elements—Focus—InvertSelection=False
Feature Browser—Focus,Selection,Navigation—Row and cell selection—MultiSelectMode=RowSelect
在脚注里显示汇总信息
Feature Browser—Summary —Total Summary—Show Footer=True;
在Feature Browser—Summary —Total Summary—右边点column,点中一列,在右边设置
FieldName为要统计的列,summaryType为要统计的类型,DisplayFormat为要显示的内容
比如“总共有 {0} 个人”,其中的{0}会在统计的时候自动替换。即使是小数,也可以用{0}来代替,系统会自动将{0}转换成要用的数据,比较智能。
在分组里边显示汇总信息
在Feature Browser—Summary —Groupl Summary右边的Group Summary里边添加字段,并设置FieldName,Display Format,Summary Type,如果要显示在分组列中,将showInGroupColumnFoot设置为showInGroupRow
单选状态下获得被选中行的某一列的值
DataRow row = gridView2.GetDataRow( gridView2.GetSelectedRows()[0]);
MessageBox.Show(row["Name"].ToString());
多选状态下获得(当然也适用于选择一个行的情况)
foreach(int i in gridView2.GetSelectedRows()) {
DataRow row = gridView2.GetDataRow(i);
MessageBox.Show(row["Name"].ToString());
}