ComboBox control in a column of DataGridView control in Visual Studio VB.NET 2005.

suchi

Newcomer
Joined
Jul 23, 2008
How can I place a comboxbox control and other controls in a column of datagridview control in vb.net ? If we can do so, then how can we access the values of these controls ?
 

ajeeshklr

Newcomer
Joined
Aug 14, 2008
Hi,

To add combobox control, just use DataGridViewComboBoxColumn.

Add one column as DataGridViewComboBoxColumn in to your datagrid view control while adding columns to your control.. Set appropriate properties for the control before adding into columns collection. Refer MSDN documentaion for more information regarding that.

To retrieve values, just add code to retrieve values in the DatagridViewCellContentClick event. Then typecast the cell content to DataGridViewComboBoxColumn. Then u can access the properties from the instance you have just created...

Cheers...:)
 
Top Bottom