Adding fields in code behind

5 posts, 1 answers
  1. Edward
    Edward avatar
    45 posts
    Member since:
    Aug 2005

    Posted 15 Apr 2012 Link to this post

    Hi

    Is it possible to add fields in code behind?

    Thanks,
    Edward
  2. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 16 Apr 2012 Link to this post

    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 >>

  3. DevCraft banner
  4. Edward
    Edward avatar
    45 posts
    Member since:
    Aug 2005

    Posted 16 Apr 2012 Link to this post

    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?
     
  5. Answer
    Maya
    Admin
    Maya avatar
    4062 posts

    Posted 16 Apr 2012 Link to this post

    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 >>

  6. EDGAR JIMENEZ
    EDGAR JIMENEZ avatar
    8 posts
    Member since:
    Apr 2010

    Posted 15 May 2012 Link to this post

    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.
Back to Top
DevCraft banner