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

DataFormDataField field editor

1 Answer 119 Views
DataForm
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 02 Jun 2011, 01:05 PM
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.

1 Answer, 1 is accepted

Sort by
0
Accepted
Pavel Pavlov
Telerik team
answered on 02 Jun 2011, 04:16 PM
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
Tags
DataForm
Asked by
John
Top achievements
Rank 1
Answers by
Pavel Pavlov
Telerik team
Share this question
or