Not wanting the web developers to have something that WPF didn’t ship with, I wrote this WPF AJAX Style ComboBox custom control.
The control, article and demo program are posted at The Code Project:
WPF AJAX Style ComboBox Custom Control.
Enjoy!
Just a grain of sand on the worlds beaches.




November 12, 2007 at 1:02 pm |
[...] Check it out here. [...]
November 13, 2007 at 2:15 pm |
[...] here to read Der Beitrag wurde am Sunday, den 11. November 2007 um 15:22 Uhr veröffentlicht und [...]
November 17, 2007 at 4:18 pm |
Karl
Are you interested in enhancing this? I’ve done some research on a smarter combobox fill. I shared the idea with an AJAX person, but he didn’t follow up on it. He was going to use JSON.
November 18, 2007 at 1:59 am |
I’m always interested in learning better ways.
Not sure what you mean by smarter. Can you provide some more detail about smarter.
November 20, 2007 at 3:33 am |
You preprocess the database table to determine reasonable criteria to apply to list members to have a sufficiently short list. Your page-building code creates one of the following two items:
1. a tree/table of leading character combinations that is used by the control’s change routine to determine when to populate the list.
2. an initialization routine that reads the tree/table data
Instead of populating the control with an Enter key press, your list would be built while the user is typing.
In a production environment, this tree/list could be built at the end of the table-updating jobs. If highly volitile, triggers might force a rebuild if a new high-level character combination appears in the table.
I found that the criteria determination was a most interesting exercise. I used a table of more than 19000
[lastname] & “, ” & [firstname]
combinations.
What would make any WPF example really shine is some way to show the tree/table traversal as the user is typing, but prior to list population. Of course, we might allow the user to circumvent this cleverness and populate the list with the Enter key. The user would pay the price in terms of list size, wait time, responsiveness, and legibility.
I have sample (VB) building code and (XLS) results. What is your email addr?
November 20, 2007 at 4:14 am |
Good job sir. I like idea. One thing to consider. I we don’t use the enter key, after the combobox is filled, we won’t be able to get to rows that are already loaded in the combobox with the keyboard.
I just emailed you at your email address.