I have a RadDataForm that contains several RadDropdownLists. They are all using client binding each with their own instance of RadClientDataSource.
How can I unsure the dropdown list data is retrieved and bound before the dataform data is retrieved and attempted to bind?
eg. I have event handler on OnSetValues as follows:
<
telerik:RadDataForm
RenderMode
=
"Lightweight"
runat
=
"server"
ID
=
"RadDataForm1"
DataKeyNames
=
"RecordID"
RenderWrapper
=
"true"
ClientDataSourceID
=
"RadClientDataSource1"
>
<
ClientSettings
>
<
ClientEvents
OnSetValues
=
"dataFormSetValues"
OnGetValues
=
"dataFormGetValues"
OnDataFormCreated
=
"dataFormCreated"
/>
</
ClientSettings
>
function
dataFormSetValues(sender, args) {
var
dataItem = args;
$telerik.findControl(document,
"EditJobTypeDD"
).findItemByValue(dataItem.JobType).select();
}
The .select() in the javascript function above will fail occasionally when the webservice for the form data returns quicker than the webservice to populate the dropdown list, because there are no items in the dropdownlist yet.
Is there a best practice to implement this sort of scenario correctly?