How to have dropdown autogenerated?

2 posts, 0 answers
  1. Rob
    Rob avatar
    37 posts
    Member since:
    Apr 2008

    Posted 31 Mar 2011 Link to this post

    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.
  2. Pavel Pavlov
    Pavel Pavlov avatar
    2039 posts

    Posted 05 Apr 2011 Link to this post

    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
Back to Top