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

How to have dropdown autogenerated?

1 Answer 54 Views
DataForm
This is a migrated thread and some comments may be shown as answers.
Rob
Top achievements
Rank 1
Rob asked on 31 Mar 2011, 10:10 PM
In your live demos overview example of RadDataForm, there is a drop-down combo box that autogenerates from the datacontext.

But nothing is revealed in the xaml or .cs source showing how this is accomplished. Can you enlighten me as to how this is done? I have used [Include] in the metadata and used .Include("blah") in the query function for the domain service class but I get a text field autogenerated and not a drop down list.

This is a simple foreign key scenario such as Employee.Employer and Employer is a valid entity of Employee within EF 4.0 EDMX. Instead I get a text field with "Employer: 1" but your online example of RadDataForm shows a dropdown with no specific code in the XAML or .cs file, so it is being completely auto-generated.

1 Answer, 1 is accepted

Sort by
0
Pavel Pavlov
Telerik team
answered on 05 Apr 2011, 02:28 PM
Hello Rob,

The online example uses enum property as source for the data field. In such case RadDataForm will completely autogenerate it.

For the case with the foreign key you will need to set up additionally some properties of the combo box field - ItemsSource, DisplayMemberPath and SelectedValueMemberPath.

Best wishes,
Pavel Pavlov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
DataForm
Asked by
Rob
Top achievements
Rank 1
Answers by
Pavel Pavlov
Telerik team
Share this question
or