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

EnableAutomaticLoadOnDemand with parametes in your datasource

2 Answers 78 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
RICHARD FRIEND
Top achievements
Rank 2
RICHARD FRIEND asked on 15 Jun 2010, 04:11 PM
When i place parameters in my datasource that i am using with my RadCombo, these parameters do not reflect the changes i make on the client.

For Example if i type in a textbox that is a paramter of the datasource linked to my combo, the server-side never gets this value ?


Is there any way to remedy this, has anyone use parameters with EnableAutomaticLoadOnDemand  ?


Thanks

2 Answers, 1 is accepted

Sort by
0
RICHARD FRIEND
Top achievements
Rank 2
answered on 18 Jun 2010, 09:14 AM
When using ControlParameters in the data source it has to access the value of these controls, however this value is not posted back so it does not work.

Any ideas how to get this to work with a datasource that uses CotnrolParameters ...?
0
Simon
Telerik team
answered on 18 Jun 2010, 02:38 PM
Hi RICHARD FRIEND,

Indeed, during a Load On Demand request each control on the page is in its initial state. Additionally the ItemsRequested server-side event fires after the DataSource has been asked for data, so you cannot use this event to set control parameters even if you have their new values.

In your case, the proper solution would be the following:
  1. Set EnableLoadOnDemand to true and EnableAutomaticLoadOnDemand to false.
  2. Handle the client-side ItemsRequesting event and use the Context object to supply all of the ControlParameter's values.
  3. Handle the server-side ItemsRequested event and use the values in the Context object, and either supply them to the Controls, which properties are used in the ControlParameters of the data source and call its Select method or simply construct your custom query to the underlying data source by using the parameter values from the client.
I hope this helps.

Kind regards,
Simon
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
ComboBox
Asked by
RICHARD FRIEND
Top achievements
Rank 2
Answers by
RICHARD FRIEND
Top achievements
Rank 2
Simon
Telerik team
Share this question
or