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

Custom DataFormDataField

2 Answers 65 Views
DataForm
This is a migrated thread and some comments may be shown as answers.
Andreas
Top achievements
Rank 1
Andreas asked on 27 Feb 2013, 06:45 PM
Hello,

I'm trying to create a custom DataFormDataField by inheriting from it. my goal is to create something similar to the DataFormDateField or CheckboxField or whatever, for different types of controls that are used as the content template.

I tried several approaches, both defining a style setting the content template and setting the style in the constructor and defining a data template as a resource and setting that in the constructor. The derived control would define certain DependencyProperties similar to the ones of the contained control which the control in the datatemplate would then bind to by FindAncestor binding.

Aside form the difficulties of locating that resource in Silverlight, I'm not getting very far. For some reason the content template does not seem to have any effect. I always see the default DataFormDataField look.

How did you create the custom DataFormDataField implementations and what is the recommended way to implement one like those, say for a RadNumericUpDown or a passwordBox or AutoCompleteBox or whatever?

Any help with a concrete example would be very much appreciated.

2 Answers, 1 is accepted

Sort by
0
Ivan Ivanov
Telerik team
answered on 04 Mar 2013, 02:14 PM
Hi,

 I have prepared a sample project for you that illustrates one of the possible ways to define your own DataField types. Please refer to it and do not hesitate to contact us back in case you need any additional assistance.

Kind regards,
Ivan Ivanov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Walter
Top achievements
Rank 1
answered on 05 Mar 2013, 04:04 PM
This works fine for us, thanks.
Tags
DataForm
Asked by
Andreas
Top achievements
Rank 1
Answers by
Ivan Ivanov
Telerik team
Walter
Top achievements
Rank 1
Share this question
or