Custom DataFormDataField

3 posts, 0 answers
  1. Andreas
    Andreas avatar
    3 posts
    Member since:
    Feb 2013

    Posted 27 Feb 2013 Link to this post


    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. Ivan Ivanov
    Ivan Ivanov avatar
    1114 posts

    Posted 04 Mar 2013 Link to this post


     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.

  3. DevCraft R3 2016 release webinar banner
  4. Walter
    Walter avatar
    22 posts
    Member since:
    Jun 2009

    Posted 05 Mar 2013 Link to this post

    This works fine for us, thanks.
Back to Top