Using same underlying object to create 2 separate screens with DataForms

2 posts, 0 answers
  1. Arvinder
    Arvinder avatar
    3 posts
    Member since:
    Jul 2013

    Posted 15 Sep 2017 Link to this post

    I am trying to create a screen with 2 tabs, each of the tabs contains a dataform. However, both tabs are bound to the same underlying screen.


    Using DataAnnotations, how can this be achieved, as each of the dataforms paints the full screen, not the fields I want on each screen.

  2. Lance | Manager Technical Support
    Lance | Manager Technical Support avatar
    1195 posts

    Posted 18 Sep 2017 Link to this post

    Hi Arvinder,

    This is not currently possible using the same object for the Source, you'd need two different objects so that you can assign annotations independently. In summary, you can't dynamically switch the annotations depending on which DataForm belongs to.

    You could try having a common base class that both objects inherit from, the 1st object for the 1st DataForm so that only the fields you want to appear there. The 2nd object for the 2nd DataForm and the fields you want there.

    In the end, combine the values of both objects in a helper method that accepts a type of the base class.

    Lance | Tech Support Engineer, Sr.
    Progress Telerik
    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 Feedback Portal and vote to affect the priority of the items
Back to Top