ultraWinGrid绑定下拉框

本文介绍了一个使用ultraWinGrid控件的例子,展示了如何通过InitializeRow事件为不同的行列绑定ultraDropDown下拉框及自定义ValueList,实现生产批次、配方号等字段的数据绑定。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

ultraWinGrid绑定ultraDropDown和自定义ValueList

private void shredDetailGrid_InitializeRow(object sender, InitializeRowEventArgs e) { ZSBatchDisplayProxy batchDisplay = new ZSBatchDisplayProxy(); //生产批次 if (e.Row.Index == 0) { foreach (UltraGridCell cell in e.Row.Cells) { if (cell.Column.Index > 0) cell.ValueList = ultraDropDown4; } } //配方号 if (e.Row.Index == 1) { foreach (UltraGridCell cell in e.Row.Cells) { if (cell.Column.Index > 0) cell.ValueList = ultraDropDown5; } } //配方批次 if (e.Row.Index == 3) { foreach (UltraGridCell cell in e.Row.Cells) { if (cell.Column.Index > 0) { DataTable data = batchDisplay.GetLeafBlendBatchNo(cbZSBatchDetail.SelectedValue + "", cbVer.SelectedValue + "", shredDetailGrid.Rows[1].Cells[cell.Column.Index].Text); ValueList vl = new ValueList(); foreach (DataRow dr in data.Rows) { vl.ValueListItems.Add(dr["配方批次"] + "", dr["配方批次"] + ""); } cell.ValueList = vl; } } } }

要在控件的InitializeRow事件中写绑定的过程

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值