If have a control that acts like a record s开发者_运维问答elector from a database, say, for example, customers.
The control must act in certain ways allowing the user to type the name, the alias or the code of the customer, and the control will select the correct one, or offer a list of possible candidates, and other behaviors.
I have tried to inherit from ComboBox
, but there are some ComboBox
behaviors that make it difficult or impossible to do what I want, so I'm better starting from scratch, with a TextBox and Button.
The questions are:
- Do you know some open-source component so I don't have to start from zero?
- Have you already done something like this and want to share methodologies or tips?
- Am I good with a TextBox, a Button and a PopUp control?
Try this control from CodeProject: A Reusable WPF Autocomplete TextBox
It allows you to specify a source list, and a custom filter. In your custom filter you can select to show only those records that have a name, alias or code that fit the text entered, and the user will have a list of filtered options displayed to them.
精彩评论