DataGrid视图组合框列 [英] DataGrid view Combobox column

查看:87
本文介绍了DataGrid视图组合框列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在DataGridView中的组合框列的选择索引更改事件上填充Datagrid视图文本框列
例如我在ProdutName(DataGridView ComboboxColumn)中有两个列,另一个是UnitMeasure(在DataGrid View TextBox列中显示的kg,Liter,PCS,grams等),因此根据组合框产品更改,它应该在textboxcolumn中显示该产品的特定单位.

How to populate Datagrid view textbox column on Select index change event of Combobox Column in DataGridView
for eg. I have two Column One in ProdutName(DataGridView ComboboxColumn) and other is UnitMeasure(in kg,Liter,PCS,grams etc Which displayed in DataGrid View TextBox column) so according to combobox product change it should display the particular unit of that product in textboxcolumn.

推荐答案

:doh:

在页面加载中为组合框填充数据源,
所选索引上的更改-使用此代码

http://www.telerik. com/community/forums/winforms/gridview/combobox-textbox-and-label-in-the-same-gridviewcell.asp [
:doh:
hmm
populate your datasource for the comboboxes in the page load,
on selected index changed - use this code

http://www.telerik.com/community/forums/winforms/gridview/combobox-textbox-and-label-in-the-same-gridviewcell.asp[^]

then set your gridsource to the one you had previously created - and loop through or set your selected to whatever was in the text field before you chagned it


这篇关于DataGrid视图组合框列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆