I have problems with the RadComBox Load-On-Demand combined with data binding.
Below is the code,
aspx
(I am using declaretive datasource (dataset) ), Below aspx is putting under FormView,
<telerik:RadComboBox Skin="Hay" ID="RadComboVendorID" runat="server"
DataSourceID="DBDataSource1" DataMember="PurchaseHeader.VendorInformation_Via_VendorID" DataTextField="VendorID" DataValueField="VendorID" SelectedValue ='<%# Bind("VendorID") %>' DropDownWidth ="550" Height ="270" Width ="105"
HighlightTemplatedItems = "true" Sort="Ascending" MarkFirstMatch="True" AutoPostBack = "true" OnItemsRequested= 'RadComboBox_ItemsRequested' EnableLoadOnDemand ="true" ShowMoreResultsBox ="true" EnableVirtualScrolling ="true" />
and, Code Behind,ItemsRequested function, I filter out the data source that binded to the page base on whatever condition, see below,
Public Sub RadComboBox_ItemsRequested(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs)
Dim combo As RadComboBox = TryCast(sender, RadComboBox)
datasource.FilterTable("VendorInformation", "VendorID LIKE '%abcedfg%'")
combo.DataSource = ds
combo.databind()
End Sub
But, it give error on combo.databind() line, say binding function must bind in the context of .................
i take away combo.databind() line, the datasource only get filtered after fresh not through AJAX posting.
Any solution for that ? Thanks .