Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Silverlight > DataForm > Adding fields in code behind

Answered Adding fields in code behind

Feed from this thread
  • Edward avatar

    Posted on Apr 15, 2012 (permalink)

    Hi

    Is it possible to add fields in code behind?

    Thanks,
    Edward

    Reply

  • Maya Maya admin's avatar

    Posted on Apr 16, 2012 (permalink)

    Hi Edward,

    Will it be possible to share a bit more details about the exact scenario that  you want to achieve ? When do you want to add a new field to the data form and to which template - read-only template, editable template or the one for inserting new item ? 

    Regards,
    Maya
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

    Reply

  • Edward avatar

    Posted on Apr 16, 2012 (permalink)

    Okay,

    I have a visitor class which has like 20 fields. Sometimes we need a 'visitor light' form entry which exposes only 5 fields.

    hmm while I was typing this I could think of 2 solutions:

    1. Create two classes in code (normal and light) and switch between them
    2. Just create one class with all the fields and cancel them out in the auto generatingField event.

    What do you think?
     

    Reply

  • Answer Maya Maya admin's avatar

    Posted on Apr 16, 2012 (permalink)

    Hi Edward,

    My recommendation would be to follow the second approach - to handle AutoGeneratingField event and cancel those fields that you do not want to be displayed.  

    Kind regards,
    Maya
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

    Reply

  • Posted on May 15, 2012 (permalink)

    Maya ,

    I need to add fields in the code behind and don't have the option of canceling fields that I don't need. Whats the best way to manually add fields to the data form?

    Thanks.

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Silverlight > DataForm > Adding fields in code behind