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

How to reference / databind controls within a dataform template?

1 Answer 73 Views
DataForm
This is a migrated thread and some comments may be shown as answers.
Walther Siksma
Top achievements
Rank 2
Walther Siksma asked on 14 Nov 2014, 09:38 PM
I added a combobox to a dataform:

<telerik:RadComboBox ID="StatusCombo" runat ="server"  SelectedValue='<%# Eval("OrganisationStatusID")%>' DropDownAutoWidth ="Enabled"  AutoPostBack ="true"   ValueType="System.Int32" Skin="<%#Container.OwnerDataForm.Skin %>" OnItemsRequested ="StatusCombo_ItemsRequested"></telerik:RadComboBox>

However the StatusCombo_ItemsRequested event  does not fire?!

Tried this:

Private Sub MainDataForm_ItemEditing(sender As Object, e As RadDataFormCommandEventArgs) Handles MainDataForm.ItemEditing
        Dim cb As RadComboBox = MainDataForm.FindControl("StatusCombo")

The event fires, but it never finds the combobox.

Are there any samples on how to reference/ databind controls (like a listbox or combobox)  contained in the edit/insert templates of the dataform ?





1 Answer, 1 is accepted

Sort by
0
Vasil
Telerik team
answered on 19 Nov 2014, 11:33 AM
Hi Walther,

In order to use the ItemRequested event you need to enable the LoadOnDemand functionality. Check this help topic for further information:
http://www.telerik.com/help/aspnet-ajax/combobox-load-on-demand-overview.html

If you want to find the ComboBox from inside the DataForm, you can handle the ItemCreated event of the form.

Regards,
Vasil
Telerik
Tags
DataForm
Asked by
Walther Siksma
Top achievements
Rank 2
Answers by
Vasil
Telerik team
Share this question
or