Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: Windows VB.NET
Hi all
Please tell me how to add multiple controls in a datagridview cell..
Thank you
Posted 25-Dec-12 21:30pm
Edited 25-Dec-12 21:58pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

not possible
you can not add controls in datagridview cell
so, you should go with some third party controls
telerik, devExpress
else use table layout panel it will give look like table (not grid)
but you can manually code it in manner that it work as gridview.
hope it help
Happy Coding!
Smile | :)
Snehasish Nandy at 26-Dec-12 3:19am
DataGridView1.Columns.Add("ID", "Product ID")
DataGridView1.Columns.Add("Name", "Product Name")

'---create a new bindingsource control---
Dim bindingsource As New BindingSource
'---add the items into the control---
bindingsource.Add("Type A")
bindingsource.Add("Type B")
bindingsource.Add("Type C")
'---create a combobox column---
Dim comboBoxCol As New DataGridViewComboBoxColumn
Dim chk As New DataGridViewCheckBoxColumn()
chk.HeaderText = "Check Data"
chk.Name = "chk"
' DataGridView1.Rows(2).Cells(3).Value = True
'---set the header---
comboBoxCol.HeaderText = "Types"
'---data bind it---
comboBoxCol.DataSource = bindingsource
'---add a combobox column to the DataGridView control---
Hi Aarti..i wrote the above code by which i m adding a single column to each cell..
Aarti Meswania at 26-Dec-12 3:34am
this way
comboboxColumn.DataSource = BindingSource;
comboboxColumn.DisplayMember = "colnm";
comboboxColumn.ValueMember = "colid";

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Mika Wendelius 236
1 Abhinav S 155
2 Peter Leow 140
3 Kornfeld Eliyahu Peter 115
4 Sergey Alexandrovich Kryukov 115
0 Sergey Alexandrovich Kryukov 8,593
1 OriginalGriff 6,536
2 Peter Leow 3,727
3 Zoltán Zörgő 3,456
4 Richard MacCutchan 2,417

Advertise | Privacy | Mobile
Web01 | 2.8.150123.1 | Last Updated 26 Dec 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100