Hi
I have a combo box that I initialise like that
Me.CbPoolType.DataSource() = Me.DatasetPoolType1.Tables("Pool_type")
Me.CbPoolType.ValueMember = DatasetPoolType1.Tables("Pool_type").Columns("Seq").ToString
Me.CbPoolType.DisplayMember = DatasetPoolType1.Tables("Pool_type").Columns("Pool_type").ToString
Me.CbPoolType.Text = ""
I have a datagrid in that same form which show data from another table(JobItem) which table Pool_type is linked to.
In JobItem I keep the seq of the PoolType.
When I double click on the datagrid I would like to display the field "Pool_type" in my combobox (which is the DisplayMember of my combo box).
I tried this
Me.CbPoolType.SelectedValue = DR.Item("Pool_type")
but it seems like I have to open the combo box first if I want it to work. Once I have open the combo box, it's working. If I don't open the combo box once, it will leave the combobox.text property empty
Any idea what I should do?
Thanks in advance
I have a combo box that I initialise like that
Me.CbPoolType.DataSource() = Me.DatasetPoolType1.Tables("Pool_type")
Me.CbPoolType.ValueMember = DatasetPoolType1.Tables("Pool_type").Columns("Seq").ToString
Me.CbPoolType.DisplayMember = DatasetPoolType1.Tables("Pool_type").Columns("Pool_type").ToString
Me.CbPoolType.Text = ""
I have a datagrid in that same form which show data from another table(JobItem) which table Pool_type is linked to.
In JobItem I keep the seq of the PoolType.
When I double click on the datagrid I would like to display the field "Pool_type" in my combobox (which is the DisplayMember of my combo box).
I tried this
Me.CbPoolType.SelectedValue = DR.Item("Pool_type")
but it seems like I have to open the combo box first if I want it to work. Once I have open the combo box, it's working. If I don't open the combo box once, it will leave the combobox.text property empty
Any idea what I should do?
Thanks in advance