http://demos.telerik.com/aspnet/prometheus/ComboBox/Examples/PopulatingWithData/AutoCompleteSql/DefaultCS.aspx
In order to increase performance and not have all of the items loaded initially.
However I'm using a custom template to display multiple columns and am uncertain how to do it. All of the examples assume one item / column and that you can just use an add method on the combobox to add additional items.
Here's my current code below. Is there a way that i could achieve this?
<
telerik:RadComboBox ID="radcbxaccountnumber" runat="server" MaxLength="16" Width="160px" DropDownWidth="340" EnableEmbeddedSkins="false" Skin="WebIE7" AllowCustomText="true" MarkFirstMatch="true" Text='<%# DataBinder.Eval(database.duckds, "Tables(0).DefaultView.(0).txtvar1") %>' EnableLoadOnDemand="true" HighlightTemplatedItems="true" ItemRequestTimeout="500" OnItemsRequested="radcbxaccountnumber_ItemsRequested" OnItemDataBound="radcbxaccountnumber_ItemDataBound" ShowMoreResultsBox="true" EnableVirtualScrolling="true">
<HeaderTemplate><table style="width:300px;text-align:left">
<tr><td style="width:75px;">Account#</td>
<td style="width:75px;">Name</td>
<td style="width:100px;">Product</td>
</tr></table></HeaderTemplate>
<ItemTemplate><table style="width:300px;text-align:left">
<tr><td style="width:75px;vertical-align:top;"><%#DataBinder.Eval(Container.DataItem, "txtvar1")%></td>
<td style="width:75px;vertical-align:top;"><%#DataBinder.Eval(Container.DataItem, "txtvar2")%></td>
<td style="width:100px;vertical-align:top;"><%#DataBinder.Eval(Container.DataItem, "reqtype", "{0}") + " " + DataBinder.Eval(Container.DataItem, "prodtype", "{0}")%></td>
</tr></table></ItemTemplate></telerik:RadComboBox>
and
Public
requestdataview As DataView
Protected Sub radcbxaccountnumber_ItemsRequested(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs)
requestdataview = database.FillDataViewWithCaching(
"getrelatedducks " + Request.QueryString("flockid") + ",1")
radcbxaccountnumber.DataSourceID =
""
radcbxaccountnumber.DataSource = requestdataview
radcbxaccountnumber.DataBind()
End Sub
Protected Sub radcbxaccountnumber_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadComboBoxItemEventArgs)
e.Item.Text = (
DirectCast(e.Item.DataItem, DataRowView))("txtvar1").ToString()
e.Item.Value = (
DirectCast(e.Item.DataItem, DataRowView))("txtvar1").ToString()
End Sub