Looking for a DropDownListBox

3 posts, 1 answers
  1. Nils
    Nils avatar
    46 posts
    Member since:
    Jul 2009

    Posted 18 Sep 2009 Link to this post

    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. Nils
    Nils avatar
    46 posts
    Member since:
    Jul 2009

    Posted 22 Sep 2009 Link to this post

    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
  3. UI for WPF is Visual Studio 2017 Ready
  4. Answer
    Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 23 Sep 2009 Link to this post

    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.
Back to Top