DevExpress 控件心得
来源:互联网 发布:竞彩足球5串6算法 编辑:程序博客网 时间:2024/05/17 09:02
1、显示表格的时候,根据数据值转换显示内容。
比如把布尔值(True、False)转换成(正确、错误)显示。
DevExpress事件CustomColumnDisplayText(在显示列中内容时触发),类似于GridView的RowDataBound事件。
private void gridView_CustomColumnDisplayText(object sender, DevExpress.XtraGrid.Views.Base.CustomColumnDisplayTextEventArgs e) { if (e.Column.FieldName == "AutoRunType") { if (e.Value.ToString() == "1") e.DisplayText = "计划"; if (e.Value.ToString() == "2") e.DisplayText = "间隔"; } }
2、获得指定行列的内容。
GetSelectedRows 获取指定的行序号,通过行序号来进行操作,
GetRowCellDisplayText 获得指定行,指定列的文本内容,
GetRowCellValue 获得指定行,指定列对应的值。
如果需要获取当前选定行(焦点所在行)的指定列的数据,那么可以通过函数GetFocusedRowCellDisplayText("ID")来获取。
int[] rowSelected = this.winGridViewPager1.GridView1.GetSelectedRows(); foreach (int iRow in rowSelected) { string ID = this.winGridViewPager1.GridView1.GetRowCellDisplayText(iRow, "ID"); BLLFactory<ItemDetail>.Instance.Delete(ID); }
3、表格的左边显示行号。
用CustomDrawRowIndicator事件实现。
private void gridView_CustomDrawRowIndicator(object sender, DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventArgs e) { e.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far; if (e.Info.IsRowIndicator && e.RowHandle >= 0) { e.Info.DisplayText = (e.RowHandle+1).ToString(); } }
0 0
- DevExpress 控件心得
- DevExpress控件LookUpEdit使用心得
- DevExpress控件XtraTreeList的使用心得
- DevExpress控件XtraTreeList的使用心得
- DevExpress控件
- DevExpress TreeList使用心得
- DevExpress TreeList使用心得
- DevExpress TreeList使用心得
- DevExpress gridcontrol使用心得
- DevExpress控件汉化
- DevExpress控件之gridControl
- DevExpress控件的使用
- TestComplete测试DevExpress控件
- DevExpress控件汉化详解
- DevExpress控件使用
- DevExpress控件汉化详解
- DevExpress控件使用
- DevExpress控件之皮肤
- 快速入门cocos2d-x jsbinding
- Java强引用、软引用、弱引用、虚引用
- 解决object is not a function
- DP 算法: cutting a rod
- Control character in cookie value, consider BASE64 encoding your value
- DevExpress 控件心得
- 微信图文消息中如何增加超链接
- sql loader
- 黑马程序员—再发一个黑马5期W元哥发来的感谢信吧,老套路,标题要长...
- 剑指offer 面试题12 在O(1)时间删除链表节点
- Android's HttpURLConnection throws EOFException
- 2013年华为机考参考代码8-29
- windows下mongo的启动
- LeetCode之逆波兰式求解