Datagridview C#中的Combobox Coloumn [英] Combobox Coloumn in Datagridview C#

查看:77
本文介绍了Datagridview C#中的Combobox Coloumn的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个datagridview,它与数据库绑定!



和一个组合框coloumn,其项目集合中包含值(好,坏,损坏) ..

用户将其更新为Bad或损坏,它没有附加数据库!

Bt在运行时值没有加载..我不知道为什么?

简单的Combobox简单物品..



然后我制作了一张有3个值的表(好,坏和损坏)并设置datasoure,显示成员,值成员并获取值..



在Combobox项目中显示值的方法是什么我缺少什么

I have a datagridview which is bounded with data base!

and a combo box coloumn with values("good",bad,damaged)in its items collection..
The user updates it to Bad or damaged,It is not attached with Database!
Bt at run time values are not loading..I do.nt know why?
It is simple as Combobox simple items..

I had then made a table having 3 values (Good,bad and damaged) and set datasoure,display member,value member and got the values..

What is the way to display values in Combobox items What am I missing

推荐答案

你可以分享你的代码,它会帮助更多。
can you share your code it will help more.


1)
for (int index = 0; index < this.gdvReturnOrder.Rows.Count; index++)
                {
                        DataGridViewComboBoxCell dc = new DataGridViewComboBoxCell();
                        dc.Items.Add("Good");
                        dc.Items.Add("Loss");
                        dc.Items.Add("Damaged");
                        this.gdvReturnOrder.Rows[index].Cells["Column9"] = dc;
                        this.gdvReturnOrder.Rows[index].Cells["Column9"].Value = dc.Items[0];
                 }



它现在显示条目bt我无法从中选择值(组合框列表

是不要掉下来)


It is showing entries now bt I am not not able to to select values from it(Combo box list
is not droping down)


这篇关于Datagridview C#中的Combobox Coloumn的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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