This is a migrated thread and some comments may be shown as answers.

Binding to dropdown

5 Answers 359 Views
ComboBox and ListBox (obsolete as of Q2 2010)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Mitch Thraves
Top achievements
Rank 2
Mitch Thraves asked on 30 Apr 2007, 11:50 PM
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

5 Answers, 1 is accepted

Sort by
0
Jordan
Telerik team
answered on 02 May 2007, 08:47 AM
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
0
Bob
Top achievements
Rank 1
answered on 07 May 2007, 02:43 AM
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...
0
Jordan
Telerik team
answered on 07 May 2007, 08:37 AM
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
0
Bob
Top achievements
Rank 1
answered on 07 May 2007, 12:50 PM
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.
0
Jordan
Telerik team
answered on 07 May 2007, 02:54 PM
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
Tags
ComboBox and ListBox (obsolete as of Q2 2010)
Asked by
Mitch Thraves
Top achievements
Rank 2
Answers by
Jordan
Telerik team
Bob
Top achievements
Rank 1
Share this question
or