0 Replies Latest reply on Nov 9, 2007 7:21 PM by bitwyse

    Has anyone created a grd, gridrow and griditem

    bitwyse Level 1
      I am trying to create a grid dynamically with the following code and I'm getting errors
      TypeError: Error #1034: Type Coercion failed: cannot convert mx.containers::Grid@4c98479 to mx.containers.GridRow.

      var tempStr : String = arrayOfFormItems[index]..type;
      objectClass = getDefinitionByName( tempStr ) as Class;
      anObject = new objectClass();
      aDynaForm.addChild( DisplayObject( anObject ) );

      I'm reading in an xml file creating items dynamically in the following order
      <formItem>
      <type>mx.containers.Grid</type>
      </formItem>

      <formItem>
      <type>mx.containers.GridRow</type>
      </formItem>

      <formItem>
      <type>mx.containers.GridItem</type>
      </formItem>

      Any thoughts?