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

被折叠的 条评论
为什么被折叠?



