This is a migrated thread and some comments may be shown as answers.

[Solved] RadCombox Binding & Load on Demand

1 Answer 127 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
w
Top achievements
Rank 1
w asked on 27 Jan 2010, 09:17 AM

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 .


1 Answer, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 01 Feb 2010, 07:30 AM
Hello,

This code seems correct, could you please send us a simple page demonstrating the problem? You should open a support ticket in order to be able to attach files?

Best wishes,
Yana
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
ComboBox
Asked by
w
Top achievements
Rank 1
Answers by
Yana
Telerik team
Share this question
or