Find control inside UserControl inside DataForm

4 posts, 0 answers
  1. Siddharth
    Siddharth avatar
    2 posts
    Member since:
    Mar 2015

    Posted 03 Aug 2015 Link to this post

    I'm using EditItemTemplate. I have included a user control in it.The user control has 2 drop downs. When I click update on the form, I want to retrieve the selected values from these 2 drop downs. How can do this using the ExtractValue method of RadDataFormEditableItem.

     

    Thanks in Advance,

    Siddharth Tandon.

  2. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 05 Aug 2015 Link to this post

    Hi,

    Try the approach below:

    protected void RadDataForm1_ItemCreated(object sender, RadDataFormItemEventArgs e)
    {
        if (e.Item is IRadDataFormEditItem)
        {
            RadDataFormEditableItem item = e.Item as RadDataFormEditableItem;
                UserControl uc = item.FindControl("UC1") asUserControl ;
            DropDownList ddl = uc.FindControl("ddl1") as DropDownList;
           
        }
    }


    Regards,
    Maria Ilieva
    Telerik
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Lulu
    Lulu avatar
    8 posts
    Member since:
    May 2015

    Posted 30 Oct 2015 in reply to Maria Ilieva Link to this post

    How do you bind to a control in the RadDataForm when you are using the Insert template? I tried casting the object as a RadDataFormInsertItem but that doesn't seem to​ work.
  5. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 02 Nov 2015 Link to this post

    Hello Lulu,

    I'm not completely sure what the required functionality you want to achieve is. I would suggest you to review the online demo below that demonstrates proper configuration for control in InsertTemplate.

    http://demos.telerik.com/aspnet-ajax/dataform/data-editing/manual-crud-operations/defaultcs.aspx

    If it does not help it will be best if you provide additional details on the exact issue you are facing and the scenario you need to implement so that we can further help.

    Regards,
    Maria Ilieva
    Telerik
Back to Top