<ext:Store ID="strNames" runat="server" OnRefreshData="strNames_RefreshData"> <Reader> <ext:JsonReader> <Fields> <ext:RecordField Name="NameId" /> <ext:RecordField Name="FullName" /> </Fields> </ext:JsonReader> <Reader> </ext:StoreID> <ext:ComboBox ID="cbNames" runat="server" StoreID="strNames" DisplayField="FullName" ValueField="NameId" HideTrigger="true" MinChars="1" />
protected void strNames_RefreshData(object sender, StoreRefreshDataEventArgs e){ // This function should take the text already typed and search for any records beginning // with the values typed. Name Search is looking in the database is: // SELECT TOP 10 * FROM Names WHERE FullName LIKE search + '%' string search = ((ListItem)cbNames.Value).Value; DataTable names = null; if (!string.IsNullOrEmpty(search)) { // Make database connection here, return results as DataTable names = namesDb.NameSearch(search); } strNames.DataSource = names; strNames.DataBind();}
This worked.All I did was add to the store:
<Proxy> <ext:DataSourceProxy /></Proxy>