从数据库中将项目填充到datagrid组合框中 [英] Populate Items into datagrid combobox from database

查看:81
本文介绍了从数据库中将项目填充到datagrid组合框中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好

我有一个列类型为组合框"的数据网格,
那么组合框必须填充数据库中的项目以供用户选择.
组合框仅填充数据库中的一个字段...

我只是不知道该怎么做...
我已经在Google论坛中搜索了..

请帮助..

Hello

I have a datagrid with a columntype as a "Combobox",
then the combobox must populate the items from the database for the user to select.
The combobox populates only one field from the database...

I just dont know how to do it...
I have search already in google,forums..

Please help..

推荐答案

jleonorlane,

您可以使用:
填充项目
Hi jleonorlane,

you can populate your items using :

DataGridViewComboBoxCell cbCell = (DataGridViewComboBoxCell)myDataGrid.Rows[0].Cells[2];
cbCell.Items.Add(.....);




您还可以查看此链接以获取其他详细信息:

http://homepage.ntlworld.com/herring1/datagrid.html [




you can also view this link for other details :

http://homepage.ntlworld.com/herring1/datagrid.html[^]

Hope this help you,
Good luck :)


这篇关于从数据库中将项目填充到datagrid组合框中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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