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

RadCombobBox automaticloadondemand

5 Answers 91 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Alan T
Top achievements
Rank 1
Alan T asked on 29 Feb 2012, 01:44 PM

Do you have to have a DataSource defined in the .aspx for htis to work ? 

What i was doing initially was databinding a list to my combobox in the code behind (page load)

I'm trying to get this working with automaticloadondemand but failing. 

I've tried adding it into itemsrequested as well but no luck. I was hoping i'd be able to do this automatically rather than have to handle the request each time and have to calculate how many items are returned and what other ones need to display (showmoreresults box)

etc etc.

Regards,

Alan

5 Answers, 1 is accepted

Sort by
0
Dimitar Terziev
Telerik team
answered on 29 Feb 2012, 01:59 PM
Hi Alan,

Please refer to the following help article regarding the automatic load on demand functionality of the RadComboBox.

Regards,
Dimitar Terziev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Alan T
Top achievements
Rank 1
answered on 29 Feb 2012, 02:41 PM

Hi Dimitar, 

had already read that.

I'm unsure what i'm doing incorrectly.

<telerik:RadComboBox ID="cbo_accounts" runat="server" Width="300" MarkFirstMatch="true"
AutoPostBack="false"
EmptyMessage="Unspecified"
DataValueField="account_id"
DropDownWidth="550"
AllowCustomText="false" Filter="Contains"
  LoadingMessage="Loading..."
OnClientFocus="singleSelect_RadComboBox_Focus"
DataTextField="e_mail"
OnClientBlur="singleSelect_RadComboBox_OnClientBlur"
HighlightTemplatedItems="true"
EnableVirtualScrolling="true"
ShowMoreResultsBox="true"
EnableAutomaticLoadOnDemand="true"
ItemsPerRequest="10">

On page load / ItemsRequested.

  Me.cbo_accounts.DataSource = account.functions.get_account_list()   (returns a list of my 'account' class)

0
Alan T
Top achievements
Rank 1
answered on 29 Feb 2012, 02:48 PM

nevermind, fixed it. 

I had wrapped my datasource definition to only apply if the page is not a postback.

0
Alan T
Top achievements
Rank 1
answered on 29 Feb 2012, 03:10 PM

Can i get some clarification on this;

Am i correct in thinking, that the datasource is only executed on binding ? hopefully that makes sense.

So in this scenario, now everytime the page is loaded i'm saying hte datasource is this query. My question being, is that query executed every page load, or only when i either click or type in the combobox ? 

0
Dimitar Terziev
Telerik team
answered on 05 Mar 2012, 10:34 AM
Hi Alan,

In the help article which I've mentioned in my previous post it's stated:
In fact you can use all types of enumerable data sources with the DataSource property. In this case, it is important to note that you set the property on each postback. RadComboBox will automatically bind to the data source whenever a request for items is made.

In your case you should set the DataSource property upon each post-back and the RadComboBox will be populate whenever a request for items is initiated.

All the best,
Dimitar Terziev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
ComboBox
Asked by
Alan T
Top achievements
Rank 1
Answers by
Dimitar Terziev
Telerik team
Alan T
Top achievements
Rank 1
Share this question
or