Binding to dropdown

6 posts, 0 answers
  1. Mitch Thraves
    Mitch Thraves avatar
    20 posts
    Member since:
    Feb 2006

    Posted 30 Apr 2007 Link to this post

    Hi

    I need to bind a dataset to the dropdown part of a RadCombo but everything I try fails so I've reverted to the VB.net Combo.

    Can you give me the basic vb.net code to get me started.

    Many thanks

    Mitch
  2. Jordan
    Admin
    Jordan avatar
    547 posts

    Posted 02 May 2007 Link to this post

    Hi Mitch,

    In  the RadComboBox\Music Collection example you can find the following code that binds the cmbArtist combo box  to the ArtistName column from the Artists DataTable in the MusicCollection dataset:

    Me.cmbArtist.DataSource = Me.artistsBindingSource  
    Me.cmbArtist.DisplayMember = "ArtistName" 
     
    Me.artistsBindingSource.DataMember = "Artists" 
    Me.artistsBindingSource.DataSource = Me.musicCollectionDataSetBindingSource  
     
    Me.musicCollectionDataSetBindingSource.DataSource = Me.musicCollectionDataSet  
    Me.musicCollectionDataSetBindingSource.Position = 0  
     
    Me.artistsTableAdapter.Fill(Me.musicCollectionDataSet.Artists) 

    I hope that answers your question properly but if you have any further questions regarding the databinding process do not hesitate to ask.

    Kind regards,
    Jordan
    the telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Bob
    Bob avatar
    2 posts
    Member since:
    Apr 2007

    Posted 06 May 2007 Link to this post

    There seems to be a problem with binding to a datatable.  Using your example, I added the following 2 lines to the "btnFillDataTable" click event handler:

                Me.radComboBox2.AutoCompleteMode = AutoCompleteMode.SuggestAppend
                Me.radComboBox2.DropDownStyle = Telerik.WinControls.RadDropDownStyle.DropDownList

    Now it is impossible to select a value by typing...
  5. Jordan
    Admin
    Jordan avatar
    547 posts

    Posted 07 May 2007 Link to this post

    Hi Mitch,

    If I understand you correctly, setting the DropDownStyle to DropDown will solve your problem.

    Regards,
    Jordan
    the telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  6. Bob
    Bob avatar
    2 posts
    Member since:
    Apr 2007

    Posted 07 May 2007 Link to this post

    Not really.  A dropdownlist is supposed to prevent the user from entering a value that isn't in the list.  I want to restrict the selection to only values in the datatable.
  7. Jordan
    Admin
    Jordan avatar
    547 posts

    Posted 07 May 2007 Link to this post

    Hi Mitch,

    Our RadComboBox does not have this feature at the moment. Currently it implements the behavior of the WinForms ComboBox. We already have that feature in out TODO list and we have planned to implement it after the Q1 2007 SP1 release.

    Kind regards,
    Jordan
    the telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top
UI for WinForms is Visual Studio 2017 Ready