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

Find control inside UserControl inside DataForm

3 Answers 228 Views
DataForm
This is a migrated thread and some comments may be shown as answers.
Siddharth
Top achievements
Rank 1
Siddharth asked on 03 Aug 2015, 02:55 PM

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.

3 Answers, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 05 Aug 2015, 12:33 PM
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
0
Lulu
Top achievements
Rank 1
answered on 30 Oct 2015, 09:46 PM
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.
0
Maria Ilieva
Telerik team
answered on 02 Nov 2015, 01:01 PM
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
Tags
DataForm
Asked by
Siddharth
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
Lulu
Top achievements
Rank 1
Share this question
or