G
Guest
Hi, has anyone probably solved the following issue:
I want to create a datagridview with a combobox displaying value from a
datatable.
This work fine as long as I 'hardcode' the necessary properties into the
datagridcolumn. Is there any way to get the property information from a
database which sort of "configures" the datagridcolumn.
ie I do a:
Dim newcol As New DataGridViewComboBoxColumn
countrytableadapter.Fill(countrytable)
newcol.DataSource = countrytable
newcol.DisplayMember = "country_name"
newcol.HeaderText = "New col"
newcol.ValueMember = "country_code"
newcol.DisplayIndex = 0
newcol.DataPropertyName = "ccy_country"
dg.Columns.Add(newcol)
all except lines 2 and 3 can be put in an sql table, but how would a make a
proper reference to object "countrytable" to instruct the grid that I want to
read from that datatable?
Any help is highly appreciated.
Thanks
I want to create a datagridview with a combobox displaying value from a
datatable.
This work fine as long as I 'hardcode' the necessary properties into the
datagridcolumn. Is there any way to get the property information from a
database which sort of "configures" the datagridcolumn.
ie I do a:
Dim newcol As New DataGridViewComboBoxColumn
countrytableadapter.Fill(countrytable)
newcol.DataSource = countrytable
newcol.DisplayMember = "country_name"
newcol.HeaderText = "New col"
newcol.ValueMember = "country_code"
newcol.DisplayIndex = 0
newcol.DataPropertyName = "ccy_country"
dg.Columns.Add(newcol)
all except lines 2 and 3 can be put in an sql table, but how would a make a
proper reference to object "countrytable" to instruct the grid that I want to
read from that datatable?
Any help is highly appreciated.
Thanks