This is a migrated thread and some comments may be shown as answers.
Using same underlying object to create 2 separate screens with DataForms
1 Answer 7 Views
This is a migrated thread and some comments may be shown as answers.
Arvinder
Top achievements
Rank 1
Arvinder asked on 16 Sep 2017, 02:20 AM

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.

1 Answer, 1 is accepted

Sort by
0
Lance | Manager Technical Support
Telerik team
answered on 18 Sep 2017, 09:40 PM
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.

Regards,
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
Asked by
Arvinder
Top achievements
Rank 1
Answers by
Lance | Manager Technical Support
Telerik team
Share this question
or