DataFormDataField field editor

2 posts, 1 answers
  1. John
    John avatar
    11 posts
    Member since:
    Jun 2011

    Posted 02 Jun 2011 Link to this post

    Hello, i would like to know if there's a way to modify the data fields editors in the AutoGeneratingFieldEventArgs event.
    I can modify things like e.DataField.Label or e.DataField.Height but i wold like to know how to acces the editor fields (more specific, i want to modify let's say, the height, width or background color of the control).

    Also in this event can i modify the type of the control that is being generate for a specific property?
    Something like: if (e.PropertyName == "Name") choose a type for the generated control.

    Thank you.
  2. Answer
    Pavel Pavlov
    Pavel Pavlov avatar
    2039 posts

    Posted 02 Jun 2011 Link to this post

    Hi John,

    Yes you can , the DataField is a content control , you may set a content template to it  and place arbitrary controls inside. You may do this in the autogenerating event , and you may also do this in XAML as demonstrated  here and here.

    There actually two options  - set the content or set the contenttempalte ( I recommend the second one ) .

    All the best,
    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