如何填充datagridview组合框单元格 [英] how to fill datagridview combobox cell
本文介绍了如何填充datagridview组合框单元格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好
当我尝试填充并从datagridviewcomboboxcell中选择值时显示错误消息System.Format异常:datagridviewcomboboxcell值无效可以帮助我解决这个问题
谢谢和问候
Nisar Aboobacker
Hi all
When i try to fill and Select value from datagridviewcomboboxcell show error Message System.Format exception : datagridviewcomboboxcell value is not valid can anyone help me to solve this
Thanks and Regards
Nisar Aboobacker
推荐答案
您好,
假设您有一个名为cmbproduct的datagridviewcombobox列。如果你想绑定数据集中的组合框值,那么
Hello ,
suppose you have one datagridviewcombobox column named as cmbproduct. and if you want to bind the combobox value from dataset then
cmbproduct.DataSource = dsproduct.Tables[0].Columns[0].Table.DefaultView;
cmbproduct.ValueMember = "PId";
cmbproduct.DisplayMember = "Pname";
并将此代码放入window_load或其他活动中。
谢谢
and put this code in window_load or other event .
thanks
这篇关于如何填充datagridview组合框单元格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文