GithubHelp home page GithubHelp logo

vain0x / dotnetkit.wpf.autocompletecombobox Goto Github PK

View Code? Open in Web Editor NEW
71.0 6.0 24.0 1.28 MB

ComboBox with filtering (auto-complete) for WPF

License: MIT License

C# 99.37% PowerShell 0.63%
wpf-controls auto-complete combobox wpf

dotnetkit.wpf.autocompletecombobox's People

Contributors

croddin avatar fruchtzwerg94 avatar tmijail avatar vain0x avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

dotnetkit.wpf.autocompletecombobox's Issues

Lastest nuget version doesn't contain the latest fix

Hi @vain0x,

After updated to the latest version of the nuget package, I still have the issue fixed by my PR on my app.
So I used DotPeek to uncompile the latest version and found that the code doesn't contain my latest fix.

Uncompiled version :
image

Current source :

var count = CountWithMax(ItemsSource?.Cast<object>() ?? Enumerable.Empty<object>(), filter, maxCount);

I don't think this is intended, so can you release a new version with the fix ?

Thank you.

Support .NET 4.0

One asked me to do that. Is just changing .net45 to .net40 enough?

MaxSuggestionCount

Hello, I am using this control well. Have you ever wanted to change the MaxSuggestionCount inside AutoCompleteComboBoxSetting, is there a way? If yes, I would appreciate it if you could show me an example.

Feature request: customize suggestions order

vain0, thank you for this piece of code. ComboBox is brilliant and perfectly works out-of-box.
I offer to improve suggestions orger. For example:
Text input: it
Current result:

git
item
iterate
community

Result requested: strings starting with it placed on the top of list:

item
iterate
git
community

Is there a way to add such tweak?

Pass the enter key event somehow?

I had been using the KeyDown event so then when I press enter in the combobox, it can start searching. Now that the first enter key input is consumed by the AutoCompleteComboBox control itself, I have to press enter twice. I mean, in Google Search, you can just select an item in the suggestion and it starts searching immediately, without your pressing enter again.

The solution I have thought of is having a new event for "input confirmed". That is, when the user just types something and presses enter, this event is raised with the text that the user typed. When the user types something and presses the arrow keys to select an item in the autocomplete list and presses enter, this event should also be raised with the selected list item's text.

Feature offer: transliteration support

Is there a way to implement automatically transliteration?
For example if I print some cyrillic symbols, but list contains only eng strings.
In this case Combobox offers suggestions as my keyboard layout is changed to eng.

up&down issue

when I type a word the dropdown will show the items matched.And I can select one by Up and Down in keyboards,the edittextbox will changed base on my selection, and it keep all the text selected.There‘s no problem by now.
However,if I press a new key in keyboards at this time.the edittextbox and the dropdownlist will be changed correspondingly.But I cannot select the item in the dropdown list by Up and Down.unless empty the edittextbox

Winforms

Can I use in winforms project?

Changing ItemsSource selects the first item

Current behaviour:

Since the 1.5 update, whenever ItemsSource is changed, SelectedItem is set to the first item in ItemsSource. This overwrites any selection that the user might have previously made.

AutoCompleteComboBox.bug.mp4

Expected behaviour:

If SelectedItem exists in the new ItemsSource, it shouldn't change. If it doesn't, the selection should be cleared.

Steps to reproduce:

See the demo in this branch. Specifically, this commit.

dynamically load items

Hello friends

First of all I apologize for asking this question here, since I do not think it is the appropriate channel, but it is the place that I see closest to a solution to my problem.

I want to use this control, but in my case I do not have a pre-loaded collection of elements, the data source has more than 30,000 records, therefore my intention is to load the data as the user enters the text.

For this reason I need to obtain the content that the user has typed, for that I create a property in my viewmodel which I link to the Text property of the ComboBox, when the property has content, I execute the query against the database.

Everything seems to work as expected, until I choose an item from the suggestion list and this causes the content of the Text property to disappear, destroying all my hopes.

Is it possible to obtain the desired behavior by establishing the correct properties or following a specific pattern?

I would appreciate any help, a link or any idea that puts me in the right direction, I have been watching content on the web for more than a week without finding a satisfactory solution to a problem that, in my opinion, does not have the greatest complexity

Thank you very much for taking the time to read this.

Drop down list always displayed?

Hi, Is there a way to have the drop down always shown? It only shows when the box is not blank. Is there also a way to reject any input thats not part of the ItemsSource? Say I enter an invalid value or something.

Item selection in ComboBox breaks if DisplayMemberPath and TextSearch.TextPath point to different properties

else if (SelectedItem != null && TextFromItem(SelectedItem) == text)

text gets filled by resolving DisplayMemberPath and TextFromItem(SelectedItem) gets filled by resolving TextSearch.TextPath.
If these properties aren't set to the same/equivalent properties SelectedItem gets unset immediatly after selection.

I tried removing TextFromItem(SelectedItem) == text and it fixed this problem and didn't introduce any new problem as far as I can tell.

Don't show empty list

It seems that when there is no matching item in the list, it still shows an empty list. Shouldn't it not display an empty list?

Autocomplete Issue when deleting text

Hi,
your ComboBox is great and works fine. However i discovered a little issue and i would be very greatful if you could solve that:

I use the combobox like this:
<dotNetKitControls:AutoCompleteComboBox ItemsSource="{Binding myList}" DisplayMemberPath="myStringItemOfmyList" TextSearch.TextPath="myStringItemOfmyList" SelectedItem="{Binding anotherValue}" SelectionChanged="Method_SelectionChanged" />

The first item of the list is auto selected when starting the program. Also this item is on focus (the text is marked) when starting.

When I now press any key to clear the marked text and search for another string, this new entered character is displayed for a very short moment. After that, the ComboBox jumps back to the initially displayed value.

Also when I delete characters of the current displayed string one after another, the following behavour occurs: Once i deleted enough characters, that more than one string would match on my current input, the ComboBox also jumps back to the initial value.

Hope my description helps. If you need more info, please ask me.

Thanks a lot in advance vor your support.

ItemsSource is incorrect when changing text search for filtering

I've come across this autocomplete but faced an issue when emptying the text search or changing the text.
Indeed, after the first filter, the ItemsSource keeps the old filter and does not reset the collection so every research after that is compromised.

Way to reproduce in the demo :

  • search for "aa": the drop-down contains now 5 items
  • search for empty string: the drop-down contains 0 items
  • search again for "aa" then search for "ad": the drop-down contains 0 items

I'm not allowed to push a fix on the repo so here we are :
In the component source code (AutoCompleteComboBox.xaml.cs), method UpdateSuggestionList, defaultItemsFilter should be set to null to be able to apply the new filter on the initial items collection

if (text == previousText) return;
// Fix : remove previous filter if the text to search does not contains or is smaller than the previous text
if (previousText?.Length > text?.Length || !text.Contains(previousText ?? string.Empty))
{
defaultItemsFilter = null;
}
// End of fix
previousText = text;

Don't select item on key down/up

Would be nice to have a setting to only select on pressing Enter, currently, when you press up/down arrows it changes the selection.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.