|
-
May 7th, 2013, 06:09 PM
#1
Thread Starter
Member
DataGridView Combobox Control
Hi guys,
Just wondering if there was a way of populating a DataGridView control during runtime so that in one column there could be a few rows set to type string followed by a combobox control cell all in the same column?
Thanks
-
May 7th, 2013, 06:17 PM
#2
Re: DataGridView Combobox Control
No! Nor indeed at any time.
As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"
Reviews: "dunfiddlin likes his DataTables" - jmcilhinney
Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!
-
May 7th, 2013, 08:37 PM
#3
Re: DataGridView Combobox Control
Yes that is completely possible and, in fact, at run time is the only time you can do it. When you add columns to a DataGridView you are specifying the template cell type for that column but, in fact, any cell in any column can be any type you want. You simply create a cell of the type you want and assign it to the grid's Item property, which gets or sets the cell at particular column and cell coordinates, e.g.
Code:
DataGridView1(1, 5) = New DataGridViewComboBoxCell()
That will put a combo box cell in the second column of the sixth row regardless of the type of that column. The cell that was at that location will be discarded.
-
May 10th, 2013, 04:26 AM
#4
Thread Starter
Member
Re: DataGridView Combobox Control
Brilliant, works a charm thanks.
-
May 10th, 2013, 11:16 AM
#5
Re: DataGridView Combobox Control
You can? Darn it! Just when you think that darned DGV straight in your head ....
As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"
Reviews: "dunfiddlin likes his DataTables" - jmcilhinney
Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|