Autocomplete combobox for WPF

After a lot of fiddling, I have managed to arrive at a complete, working solution. (Or so it seems.) Step 1. Modify XAML markup You need to modify your ComboBox like so: <ComboBox … IsTextSearchEnabled=”False” … PreviewTextInput=”PreviewTextInput_EnhanceComboSearch” PreviewKeyUp=”PreviewKeyUp_EnhanceComboSearch” DataObject.Pasting=”Pasting_EnhanceComboSearch” /> ie. to disable default text search, and add events handlers that will take care of … Read more

Rails gem rails3-jquery-autocomplete: How do I query multiple fields

Your pseudo attribute works only on records already retrieved, but it has no bearing on searching for records. Probably the easiest solution is a named named scope like: scope :search_by_name, lambda { |q| (q ? where([“first_name LIKE ? or last_name LIKE ? or concat(first_name, ‘ ‘, last_name) like ?”, ‘%’+ q + ‘%’, ‘%’+ q … Read more

ComboBox AutoComplete on SubString

Here is the C# version. It has a lot of options to it. using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace WindowsFormsApplication1 { public partial class Form1 : Form { public Form1() { this.Load += new EventHandler(this.Form1_Load); InitializeComponent(); } private clsCustomAutoCompleteTextbox ClsCustomAutoCompleteTextbox1 = null; private List<string> … Read more

jquery autocomplete with json response

$(“#users-allowed”).autocomplete(“/people/following.json”, { width: 320, dataType: ‘json’, highlight: false, scroll: true, scrollHeight: 300, parse: function(data) { var array = new Array(); for(var i=0;i<data.items.length;i++) { array[array.length] = { data: data.items[i], value: data.items[i], result: data.items[i].username }; } return array; }, formatItem: function(row) { var name=””; if (row.first_name && row.last_name) name=”(“+row.first_name+’, ‘+row.last_name+’)’; else if (row.first_name) name=”(“+row.first_name+’)’; else if (row.last_name) … Read more