动态加载button,checkbox,dropdrow等控件

UltraGrid的使用(一):经常使用的技术     优快云 Blog推出文章指数概念,文章指数是对Blog文章综合评分后推算出的,综合评分项分别是该文章的点击量,回复次数,被网摘收录数量,文章长度和文章类型;满分100,每月更新一次。

 对于Grid是我们在程序中最常用到的麻烦控件,他有很强大的功能,有时候为了一个小小属性就能实现的功能,可能你要研究半天,我就是这样。现在来总结一下可能会经常使用到的功能。

1。动态加载button,checkbox,dropdrow等控件。

 ultraGrid1.DisplayLayout.Bands[0].Columns["button"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.Button;

ColumnStyle是列样式,它是个枚举类型,里面是各种常用的类型,TriStateCheckBox.,Edit,Button,.Edit.DropDownValidate,.DropDownList,.DropDownCalendar,.DropDown.,CheckBox.Button.。

添加button后,他的响应事件是ClickCellButton。

2。使某一列不能编辑。同上Antivatian也是枚举类型。

 ultraGrid1.DisplayLayout.Bands[0].Columns["id"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.ActivateOnly;

3。使某一单元格不能编辑

 ultraGrid1.Rows[0].Cells[1].Activation = Infragistics.Win.UltraWinGrid.Activation.ActivateOnly;

4。获取点击或选中某一行的索引,并得到其中某一值

 int i = this.ultraGrid1.ActiveRow.Index;
 
string id = this.ultraGrid1.Rows[i].Cells[0].Value.ToString().Trim();

 5加载ColumnStyle没有的控件,如:progressbar等

 ultraGrid1.DisplayLayout.Bands[0].Columns["progressbar"].EditorControl = new Infragistics.Win.UltraWinProgressBar.UltraProgressBar();


Trackback: http://tb.blog.youkuaiyun.com/TrackBack.aspx?PostId=1713683 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值