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

Looking for a DropDownListBox

2 Answers 71 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Nils
Top achievements
Rank 1
Nils asked on 18 Sep 2009, 03:02 PM
Hi.
I am trying to do the following:
I want to create a ComboBox which can be used like an editable Combobox (i.e. type into the Textfield and select from the auto-complete..) but only entries currently in the combobox shuld be selectable.

The description for the 3rd Combobox on the Combobox/Fist Look Examples page reads somehat like this but typing ist not allowed in that Combobox. (What I expected by setting IsReadOnly, anyhow..)

So - Is it posiible to transform the DropDownCombobox into a keyboard-navigateable-but-non-entiable-Combobox ?

Yours,
Nils

2 Answers, 1 is accepted

Sort by
0
Nils
Top achievements
Rank 1
answered on 22 Sep 2009, 08:26 AM
I managed to get this working using a ValidationRule on Selecteditem:
<telerik:RadComboBox ItemsSource="{Binding Path=AllBars, Mode=OneWay}" 
                     Margin="100,2,0,2" 
                     IsEditable="True"
     <telerik:RadComboBox.SelectedItem> 
          <Binding Path="Foo.Bar" 
                   Mode="TwoWay" 
                   NotifyOnValidationError="True"
               <Binding.ValidationRules> 
                    <ui:ListBoxValidationRule /> 
               </Binding.ValidationRules> 
          </Binding> 
     </telerik:RadComboBox.SelectedItem> 
</telerik:RadComboBox> 

The ValidationRule looks like this:
public class ListBoxValidationRule : ValidationRule 
    public override ValidationResult Validate(object value, CultureInfo cultureInfo) 
    { 
        return value==null ? new ValidationResult(false"Not Valid...") : new ValidationResult(true""); 
    } 

However, I am not sure if this is the "right" way to do this.

Nils
0
Accepted
Valeri Hristov
Telerik team
answered on 23 Sep 2009, 11:46 AM
Hi Nils,

The our WPF combobox should do exactly what you need, but it contains a bug that prevents the user from typing in read-only mode. See the Silverlight combo (that shares the same source code):
http://demos.telerik.com/silverlight/#ComboBox/FirstLook

This problem is scheduled for fixing, most probably we will release an internal build, containing the fix before the Q3 2009 release (November). It will be fixed in Q3 for sure. I cannot promise a specific date for resolution, so I would recommend using your workaround for now. We will make sure that the bug will be fixed as soon as possible.

All the best,
Valeri Hristov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
ComboBox
Asked by
Nils
Top achievements
Rank 1
Answers by
Nils
Top achievements
Rank 1
Valeri Hristov
Telerik team
Share this question
or