C# devExpress GridControl 行中行 子行 多级行
来源:互联网 发布:中国白银集团淘宝店 编辑:程序博客网 时间:2024/05/18 00:18
在工作中经常会碰到需要做行中行,多级行的情况,不熟的情况下,我也只能试着实现.
命名空间
using DevExpress.XtraEditors.Repository;using System.Data.SqlClient;
实现代码
一下实现的也只是一个demo,大家不要拘泥于数据
DB db = new DB(); DataSet ds = new System.Data.DataSet(); SqlCommand comm2 = new SqlCommand(sql, db.getSqlConnection()); //db.getSqlConnection() 返回一个sqlConnection 对象 SqlCommand comm3 = new SqlCommand(sql1, db.getSqlConnection()); SqlCommand comm4 = new SqlCommand(sql2, db.getSqlConnection()); SqlDataAdapter da2 = new SqlDataAdapter(comm2); SqlDataAdapter da3 = new SqlDataAdapter(comm3); SqlDataAdapter da4 = new SqlDataAdapter(comm3); da2.Fill(ds,"emp"); da3.Fill(ds,"job"); da4.Fill(ds,"re"); this.treeListLookUpEdit1TreeList.DataSource = ds; DataColumn parentColumn = ds.Tables["emp"].Columns["empNum"]; DataColumn childColumn = ds.Tables["job"].Columns["empNum"]; DataColumn secondChild = ds.Tables["re"].Columns["empNum"]; DataRelation relCustOrder; relCustOrder = new DataRelation("对应工作", parentColumn, childColumn); DataRelation job; job = new DataRelation("部门调整", childColumn, secondChild); ds.Relations.Add(relCustOrder); ds.Relations.Add(job); this.gridControl1.DataSource = ds.Tables["emp"];实现效果如下:
0 0
- C# devExpress GridControl 行中行 子行 多级行
- C# devExpress GridControl 统计行总数
- devexpress gridControl 隔行 奇偶行变色
- DevExpress的GridControl的行编辑
- DevExpress GridControl 行头显示行信息
- DevExpress GridControl 行记录上移,下移功能
- DevExpress GridControl 设置单元格 某一行的背景色
- DevExpress GridControl复合表头(多行表头)设置
- DevExpress.XtraGrid.GridControl 单击某一行获取数据问题
- DevExpress GridControl复合表头(多行表头)设置 .
- DevExpress GridControl复合表头(多行表头)设置
- 拖拽Devexpress的GridControl的行到PanelControl
- DevExpress GridControl复合表头(多行表头)设置
- DevExpress中GridControl中添加编辑按钮行
- DevExpress中GridControl中实现checkbox多行选中
- DevExpress GridControl复合表头(多行表头)设置BandedGridView
- DevExpress GridControl 控件中GridView 加组,加行
- DevExpress GridControl复合表头(多行表头)设置
- NDK_MODULE_PATH
- C++ primer (5th) 随想与学习笔记 7 执行流程永不变 新标准添精彩
- 黑马程序员——反射
- solr4.8中集成mmseg4j1.9.1
- eclipse 鲜为人知的调试技巧,你用过多少
- C# devExpress GridControl 行中行 子行 多级行
- poj 2151 Check the difficulty of problems(概率dp)
- 手势识别器
- linux常用c函数字符串转换篇
- csdn还是"待审核"吗?
- js创建对象和继承
- POJ 1279 Art Gallery
- Java中I/O流
- mysql connector odbc配置注意事项