Results 1 to 2 of 2

Thread: Combobox and checkbox binding???

  1. #1

    Thread Starter
    Member
    Join Date
    Aug 2009
    Posts
    34

    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??

  2. #2
    Member cyberM's Avatar
    Join Date
    Mar 2009
    Location
    Croatia , Zagreb
    Posts
    61

    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..
    If you satisfied add to reputation





    PhotoResizer GDI+Shape form,shape inside

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width