954,500 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Add combo to bounded datagridview

Hi.
I have a bounded datagridview and it's work fine.
I want to know if I can to add a combobox column to datagridview.

Thanks for all.

alinutzu
Newbie Poster
4 posts since Sep 2008
Reputation Points: 10
Solved Threads: 0
 

Sure you can. Simply create new DGVcomboBox column and add or insert it to dgv columns.

DataGridViewComboBoxColumn cmbcolumn = new DataGridViewComboBoxColumn(); 
{
    cmbcolumn.Name = "cmbColumn";
    cmbcolumn.HeaderText = "combobox column"; 
    cmbcolumn.Items.AddRange(new string[] { "aa", "ac", "aacc" }); //items in comboBox
}
dataGridView1.Columns.Insert(1, cmbcolumn); //inserting comboBox into 2nd columns (colimn at index 1)
Mitja Bonca
Nearly a Posting Maven
2,485 posts since May 2009
Reputation Points: 641
Solved Threads: 474
 

Hi. I have a bounded datagridview and it's work fine. I want to know if I can to add a combobox column to datagridview.

Thanks for all.


Try links: http://weblogs.asp.net/manishdalal/archive/2008/09/28/combobox-in-datagrid.aspx
http://stackoverflow.com/questions/3684154/how-to-add-a-combobox-to-an-asp-net-unbound-gridview


Hope it Helps...!!!

riteshbest
Light Poster
30 posts since Nov 2009
Reputation Points: 15
Solved Threads: 4
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: