G
Guest
I have a DatagridView bound to a bindingsource. I programmatically add a
ComboboxColumn and bind it to another BindingSource like this:
Dim colActType As New DataGridViewComboBoxColumn
colActType.DataSource = ActivityTypesBindingSource
colActType.HeaderText = "Activity Type"
colActType.DataPropertyName = "ActivityTypeId"
colActType.ValueMember = "Id"
colActType.DisplayMember = "Descr"
DataGridView1.Columns.Add(colActType)
The values behave as expected. The displayed values in the Combobox
correctly display the value from the Descr field. Changing the value saves
correctly to the main table. The problem is that when the DataGridView
displays, the Combobox column displays the value in the ValueMember field.
When I click in the combobox, it shows the DisplayMember value, but reverts
back when I click or tab away.
Any thoughts would be helpful.
Barry
PS: Apologies if this message posts twice. I'm not sure why that is
happening here.
ComboboxColumn and bind it to another BindingSource like this:
Dim colActType As New DataGridViewComboBoxColumn
colActType.DataSource = ActivityTypesBindingSource
colActType.HeaderText = "Activity Type"
colActType.DataPropertyName = "ActivityTypeId"
colActType.ValueMember = "Id"
colActType.DisplayMember = "Descr"
DataGridView1.Columns.Add(colActType)
The values behave as expected. The displayed values in the Combobox
correctly display the value from the Descr field. Changing the value saves
correctly to the main table. The problem is that when the DataGridView
displays, the Combobox column displays the value in the ValueMember field.
When I click in the combobox, it shows the DisplayMember value, but reverts
back when I click or tab away.
Any thoughts would be helpful.
Barry
PS: Apologies if this message posts twice. I'm not sure why that is
happening here.