读书笔记 UltraGrid(15)

几个词的含义:
Layout:布局,整体的布置方式。比如卡片视图、列头的位置、行布局;
Appearance:外观。比如前、背景颜色、文字对齐、图片等;
Style:风格。感觉这个是包含Appearance,大部分的都是通过Appearance来调整的。
1.在ultragrid中,你可以自定义preset用于grid,这样可以保持控件风格的一致性。
preset包含了外观和行为。
行为如是否可多选、可编辑等等。
2.分组布局
this.ultraGrid1.DisplayLayout.Bands[1].RowLayoutStyle = RowLayoutStyle.GroupLayout;
this.ultraGrid1.DisplayLayout.Bands[1].Header.Appearance.TextVAlign = VAlign.Middle;
           
this.ultraGrid1.DisplayLayout.Override.AllowRowLayoutColMoving = Infragistics.Win.Layout.GridBagLayoutAllowMoving.AllowAll;

           
UltraGridBand ugb=this.ultraGrid1.DisplayLayout.Bands[1];

UltraGridGroup ugd = ugb.Groups.Add("SpecInfo", "规格信息");

UltraGridGroup ugd1 = ugb.Groups.Add("SizeInfo", "尺寸信息");
UltraGridGroup ugd2 = ugb.Groups.Add("AddInfo", "辅助信息");

ugb.Groups["SizeInfo"].RowLayoutGroupInfo.ParentGroup = ugd;
ugb.Groups["AddInfo"].RowLayoutGroupInfo.ParentGroup = ugd;

ugb.Columns["SpecWth"].RowLayoutColumnInfo.ParentGroup = ugd1;
ugb.Columns["SpecHgt"].RowLayoutColumnInfo.ParentGroup = ugd1;
ugb.Columns["SpecSqr"].RowLayoutColumnInfo.ParentGroup = ugd2;
ugb.Columns["SpecWgt"].RowLayoutColumnInfo.ParentGroup = ugd2;
ugb.Columns["SpecGth"].RowLayoutColumnInfo.ParentGroup = ugd2;

foreach(UltraGridColumn ugc in ugb.Columns)
   ugc.RowLayoutColumnInfo.SpanY = 0;
3:RowLayout:可以对每行中的单元格进行布局。
UltraGridBand band = this.ultraGrid1.DisplayLayout.Bands[0];
band.RowLayoutStyle = RowLayoutStyle.ColumnLayout;

RowLayout rl1 = band.RowLayouts.Add("rl1");
rl1.ColumnInfos["OrdrID"].Initialize(0, 0, 2, 2);
rl1.ColumnInfos["CustID"].Initialize(2, 0, 2, 2);
rl1.ColumnInfos["OrdrProj"].Initialize(0, 2, 4, 2);

band.RowLayouts["rl1"].Apply();

RowLayout rl2 = band.RowLayouts.Add("rl2");
rl2.ColumnInfos["OrdrID"].Initialize(0, 0, 2, 2);
rl2.ColumnInfos["CustID"].Initialize(0, 2, 2, 2);
rl2.ColumnInfos["OrdrProj"].Initialize(2, 0, 2, 4);

band.RowLayouts["rl2"].Apply();


 

转载于:https://www.cnblogs.com/chump/archive/2012/02/14/2351869.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值