ultraGrid 定制单元格合并逻辑
来源:互联网 发布:淘宝账号哪里买 编辑:程序博客网 时间:2024/06/05 09:05
1.在初始化表格中进行的设置
e.Layout.Bands[0].Columns["EXEC_RESULT"].MergedCellStyle = MergedCellStyle.Always;
e.Layout.Bands[0].Columns["EXEC_RESULT"].MergedCellEvaluator = new CustomMergedCellEvaluator();2.设置合并行的逻辑
public class CustomMergedCellEvaluator :IMergedCellEvaluator
{
public CustomMergedCellEvaluator() { }
// 合并日期相同的单元格(无需时间精确相同)
public bool ShouldCellsBeMerged(UltraGridRow row1, UltraGridRow row2,UltraGridColumn column) //控件自带的方法,会自动进行调用,column为初始化中设置的行
{
string date1 = (string)row1.GetCellValue(column);//上边设置的列column->为EXEC_RESULT
string date2 = (string)row2.GetCellValue(column);
string comb1 = (string)row1.GetCellValue("COMB_NO");
string comb2 = (string)row2.GetCellValue("COMB_NO");
DateTime time1 = (DateTime)row1.GetCellValue("USE_TIME");
DateTime time2 = (DateTime)row2.GetCellValue("USE_TIME");
return (date1 == date2)&&(comb1==comb2)&&(time1==time2);
}
}
从帮助手册中摘录出来的原文
ShouldCellsBeMerged Method
Infragistics.Win.UltraWinGrid Namespace > IMergedCellEvaluator Interface : ShouldCellsBeMerged Method
Returns true if the cells of row1 and row2 associated with the column should be merged.
Syntax
Parameters
- row1
- An UltraGridRow
- row2
- An UltraGridRow
- column
- The UltraGridColumn
using Infragistics.Shared;using Infragistics.Win;using Infragistics.Win.UltraWinGrid;using System.Diagnostics; private class CustomMergedCellEvaluator : Infragistics.Win.UltraWinGrid.IMergedCellEvaluator { public bool ShouldCellsBeMerged( UltraGridRow row1, UltraGridRow row2, UltraGridColumn column ) { DateTime date1 = (DateTime)row1.GetCellValue( column ); DateTime date2 = (DateTime)row2.GetCellValue( column ); // Merge cells according to the date portions of the underlying DateTime cell // values, ignoring any time portion. For example, "1/1/2004 10:30 AM" will be // merged with "1/1/2004 1:15 AM" since the dates are the same. return date1.Date == date2.Date; } } private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e) { // Set the MergedCellStyle property to enable the merged cell functionality. // MergedCellStyle also specifies which columns will merge their cells. e.Layout.Override.MergedCellStyle = MergedCellStyle.Always; // MergedCellEvaluator property can be used to speficy custom logic for // merging cells. e.Layout.Bands[0].Columns["ShipDate"].MergedCellEvaluator = new CustomMergedCellEvaluator( ); }
0 0
- ultraGrid 定制单元格合并逻辑
- UltraGrid单元格放多个图片
- 定制单元格
- 定制单元格
- ultraGrid的单元格怎么自动换行
- 单元格合并
- 合并单元格
- 合并单元格
- 合并单元格
- 合并单元格
- 单元格合并
- 合并单元格
- UltraGrid
- UltraGrid
- UltraGrid的使用(二):单元格输入内容的验证
- 上下左右键控制ultraGrid单元格数据的移动
- 在TTTableViewController定制单元格
- 定制单元格的用户界面。
- rosrun和roslaunch区别解析
- Android退出程序时的"再按一次退出"实现
- libevent介绍
- 实现细节,hash对key为 null的处理,对重哈希的处理
- Node.js 常用工具 util
- ultraGrid 定制单元格合并逻辑
- SDL2在MAC OS X 10.9/10.10 XCode 5下的配置安装
- mysql -u root -p 等这些常用的参数
- ARM微处理器的指令的分类与格式
- HDU2037 今年暑假不AC 【贪心】
- 【PAT (Advanced Level)】1058. A+B in Hogwarts (20)
- 使用 libevent 和 libev 提高网络应用性能
- ganglia和nagios配置实现hadoop集群监控
- 13.PHP内核探索:如何执行PHP脚本