DevExpress中GridControl基础用法

1.获取行号

//获得选中的行,如果是单选模式,则直接选取第一个
int SelectedLineNo = gridView1.GetSelectedRows()[0];

2.指定行和列属性获取单元格数据

//指定行和列属性名取单元格数据
string name = gridView1.GetRowCellValue(SelectedLineNo,"Name").ToString();

3.隐藏GridControl的GroupPanel表头

Run Designer -> Views -> OptionsView -> ShowGroupPanel  = False

4.单击记录整行选中的问题

Run Designer -> Views -> OptionsBehavior -> EditorShowMode  = Click

5.GridContorl记录能获取不显示的问题

gridView1.populateColumns() //会将所有的绑定数据都显示出来

6.只能选择不能编辑(或者编辑某一单元格)

1.Run Designer -> Views -> OptionsBehavior-> EditorShowMode  = Click
2.Run Designer -> Views -> OptionsBehavior-> Editable = false

7.禁用GridContorl中单击列弹出右键菜单

Run Designer -> OptionsMenu -> EnableColumnMenu = false

8.禁用列头的过滤器

Run Designer -> OptionsCustomization -> AllowFilter  = false

9.如何不显示横向滚动条

Run Designer -> Views ->OptionsView -> ColumnAutoWidth = false

10.表格表头居中显示

Run Designer -> Views ->Appearance -> HeaderPanel -> TextOptions -> HAlignment = Center

11.列内容居中显示

Run Designer -> Columns -> 列 -> AppearanceCell -> TextOptions -> HAlignment = Center

fC9BTpsoz

 

© 版权声明
THE END
喜欢就支持一下吧
点赞13 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容