Click here to Skip to main content
Sign Up to vote bad
good
See more: WindowsVB.NET
Hi all
 
Please tell me how to add multiple controls in a datagridview cell..
 
Thank you
Posted 25-Dec-12 20:30pm
Code-Hunt2.7K
Edited 25-Dec-12 20:58pm


1 solution

not possible
 
you can not add controls in datagridview cell
 
so, you should go with some third party controls
e.g
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 | :)
  Permalink  
Comments
Snehasish Nandy - 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--- DataGridView1.Columns.Add(comboBoxCol) DataGridView1.Columns.Add(chk) Hi Aarti..i wrote the above code by which i m adding a single column to each cell..
Aarti Meswania - 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
Your Filters
Interested
Ignored
     
0 Christian Graus 477
1 Ron Beyer 316
2 samadhan_kshirsagar 269
3 Tadit Dash 243
4 OriginalGriff 181
0 Sergey Alexandrovich Kryukov 7,061
1 Prasad_Kulkarni 3,815
2 OriginalGriff 3,557
3 _Amy 3,370
4 CPallini 3,034


Advertise | Privacy | Mobile
Web02 | 2.6.130619.1 | Last Updated 26 Dec 2012
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid