How to reference / databind controls within a dataform template?

2 posts, 0 answers
  1. Walther Siksma
    Walther Siksma avatar
    12 posts
    Member since:
    May 2006

    Posted 14 Nov 2014 Link to this post

    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 ?

  2. Vasil
    Vasil avatar
    1540 posts

    Posted 19 Nov 2014 Link to this post

    Hi Walther,

    In order to use the ItemRequested event you need to enable the LoadOnDemand functionality. Check this help topic for further information:

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

  3. DevCraft R3 2016 release webinar banner
Back to Top