如何在datagridview组合框单元格中添加项目 [英] How to add items in a datagridview combobox cell

查看:188
本文介绍了如何在datagridview组合框单元格中添加项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将项目添加到datagridview组合框列中已存在的组合框单元格中,
每行在组合框列中包含一个不同的项目,
我想将项目添加到特定行的特定组合框单元格,
我尝试了类似的方法,但是没有用:

How can I add items to an already existing combobox cell in a datagridview combobox column ,
Each row contains a different items in the combobox column ,
I want to add the items to the specific combobox cell of a specific row ,
I tried something like this but it didn''t work :

dataGridView1.Rows[0].Cells[2].Items.Add();



谢谢.



Thank you .

推荐答案

DataGridViewComboBoxColumn colType = new DataGridViewComboBoxColumn(); 
colType.HeaderText = "Type"; 
colType.DropDownWidth = 90; 
colType.Width = 90; 
colType.MaxDropDownItems = 5; 
this.dataGridView1.Columns.Insert(7, colType); 
colType.Items.AddRange("A", "N", "P", "S", "Z"); 
this.dataGridView1.Columns[7].DataPropertyName = "trans_type";




这可能会有所帮助




this can help may be


使用此链接

http://homepage.ntlworld.com/herring1/datagrid.html
use this link

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


我需要一种在datagridview的组合框列中的特定行的特定单元格中添加项目的方法,
谁能帮助我.
I need a way to add items in specific cell of a specific row in the combobox column of a datagridview ,
Can anyone help me.


这篇关于如何在datagridview组合框单元格中添加项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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