Populate a combobox on a DataGridView control [modified]
-
Hi, I am fairly new to VB.net and I am stuck on how to populate the list portion of a combo box that is part of a DataGridView control I have got as far as using the example code on the MS Help, which is for a text box, and changed it to a combo box, and I have prepared a binding source with the data, but I cannot see anything in the properties that lets me attach the binding source to the combo box Private Sub CustomiseUnitsColumn() 'Creates the drop down boxes for the units Dim column As DataGridViewColumn = sggData.Columns("Unit ID") Dim cell As DataGridViewCell = New DataGridViewComboBoxCell column.CellTemplate = cell End Sub Can anyone point me in the right direction?:confused: Er actually the 'cell' thing does not work either. I get the message: System.InvalidCastException was unhandled Message="Value provided for CellTemplate must be of type System.Windows.Forms.DataGridViewTextBoxCell or derive from it." Source="System.Windows.Forms" I am even more confused now!:confused::confused: -- modified at 11:38 Friday 30th March, 2007 -- modified at 11:41 Friday 30th March, 2007
David Loring !! Keep Music Live !!