Combobox and checkbox binding???
I have the following code in the Load event of my form.
ARoomsBedsDataTier = New RoomsBedsDataTier
ACottagesDataSet = ARoomsBedsDataTier.GetDataSet
'Set up Room Binding Source
Dim RoomBindingSource As New BindingSource
With RoomBindingSource
.DataSource = ACottagesDataSet
.DataMember = "Rooms"
End With
'Bind the combo box and the check to the Rooms table
With cboRoomName
.DataSource = RoomBindingSource
.DisplayMember = "Room"
.ValueMember = "Room"
'.SelectedIndex = -1
End With
chkJacuzzi.DataBindings.Add("Checked", RoomBindingSource, "Jacuzzi", False)
chkPrivateAccess.DataBindings.Add("Checked", RoomBindingSource, "Private Access", False)
chkFireplace.DataBindings.Add("Checked", RoomBindingSource, "Fireplace", False)
This works, however I want the code to reside in the SelectionChangeCommitted event of my combo box instead. That way there is no initial values in the form when it loads. I have tried many ways to do this but can't seem to get it to work.
Can anyone help??
Re: Combobox and checkbox binding???
I suppose you must bind data in Form load event too..
Do you have to use data source or some other techniques this is your choice..