0

I have multiple comboboxes on a WPF window. Each is populated from a ViewModel. I am trying to implement AutoComplete. I have tried using a WPF combobox and telerik combobox. I can't even begin to test whether my autocomplete functionality is workign or not because I cannot type in the combobox. i can only use backspace and spacebar. I have IsEditable set to true. Is there something very basic I am missing?

My xaml from one of the comboboxes

<DockPanel Style="{StaticResource DockPanelStyle}">
                                <Label Content="Model" DockPanel.Dock="Top"/>
                                <telerik:RadComboBox x:Name="cboModel" DockPanel.Dock="Bottom" Width="100"  ItemsSource="{Binding Path=Models}"
                                         ItemTemplate="{StaticResource ComboBoxCustomTemplate}"  IsEditable="True" StaysOpenOnEdit="True"
                                         telerik:TextSearch.TextPath="value"/>
</DockPanel>

The DockPanel above is inside a stackpanel which is inside a grid.

Here is the relevant code from my ViewModel

  public void LoadModels()
        {
            try
            {
                List<CommonData.Model> model = factory.GetStaticModels();
                foreach (CommonData.Model m in model)
                {
                    Models.Add(new CommonData.Model()
                    {
                        value = m.value
                    });
                }
            }
            catch (Exception ex)
            {
                //leaving this out
            }
        } 

private List<CommonData.Model> _models = new List<CommonData.Model>();
        public List<CommonData.Model> Models
        {
            get
            {
                return _models;
            }
            set
            {
                _models = value;
                OnPropertyChanged("Models");
            }
        }

And finally, this is my Model class(not MVVM Model, the name of the class is Model)

[Serializable]

    public class Model
    {
        private string models;
        public string value
        {
            get;
            set;
        }
    }

Any help/suggestions greatly appreciated. I am very new to WPF and I feel like I am missing something very basic but having spent a good part of 3-4 days on this, its becoming quite ridiculous now.

1 Answers1

0

IsTextSearchEnabled = "True" for standard combobox

dblk1965
  • 132
  • 4