Dynamically build Form Panel

  1. #1

    Dynamically build Form Panel

    Hi,

    Is it possible to dynamically build a form panel. It would see not? I have tried using a repeater to build one up but the Form Layout only accepts Anchors as its children. It also doesnt seem possible to create Anchors with code as I cant set the control for it to display. Can it only be created using HTML markup?

    Thanks
  2. #2

    RE: Dynamically build Form Panel

    I have figured out how to do it, for anyone who is interested you can try this:

    
     Anchor anchor = new Anchor();
    
     TextField tf = new TextField();
     tf.ID = "fileId";
     tf.FieldLabel = "label Name";
     tf.Text = "Value";
    
     anchor.Items.Add(tf);
    
     FormLayout1.Anchors.Add(anchor);



  3. #3

    RE: Dynamically build Form Panel

    Hi,

    All what you see in markup can be created via code-behind because markup is instruction only for ASP.NET to build that code dynamically.


    Please, show how you try to create FormPanel in code-behind
  4. #4

    RE: Dynamically build Form Panel

    I do have an issue trying to create these fields though with an AjaxEvent on a grid.

    I have a window that pops up when the RowSelection AjaxEvent fires. If I try and load the formpanel in the window and create fields dynamically it doesnt work.

    It does however if I just use a button to manually open the window and create the fields.

    Does anyone know why?
  5. #5

    RE: Dynamically build Form Panel

    Hi,

    Creation controls during AjaxEvent is not supported (any control should be created on initial Page_Load). We are planning to include such functionality to the 1.0 release
  6. #6

    RE: Dynamically build Form Panel

    Thank you for your reply

Similar Threads

  1. Replies: 5
    Last Post: May 11, 2012, 4:56 PM
  2. [CLOSED] Adding Elements to a form dynamically
    By ljcorreia in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Jun 21, 2011, 4:33 PM
  3. [CLOSED] To much recursion error from dynamically created Form
    By rthiney in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Apr 11, 2011, 3:09 PM
  4. Replies: 0
    Last Post: Apr 09, 2009, 4:49 PM
  5. Dynamically adding form fields
    By sz_146 in forum 1.x Help
    Replies: 4
    Last Post: Nov 11, 2008, 11:10 AM

Posting Permissions