4 Replies Latest reply on Mar 26, 2008 8:52 PM by cxf02

    Height of custom components

    P Steven Level 1
      I am having real difficulty trying to display my content without vertical scroll bars appearing.

      One such scenario is I have a repeated custom component. The custom component is a line of text and a datagrid. The datagrid height will vary due to the number of rows of dynamic data.

      I am trying to work out what settings I need to get the datagrids to display all their data without including a vertical scrollbar. I have not set a height for my custom component, in the hope it will just resize to whatever height it needs to display the datagrid. I have however set a height of 100% for the datagrid in the custom component.

      If I do not set a height for the datagrid, then it will indeed display all the content without any vertical scroll bars BUT it seems to resize all the datagrids to the height of the largest datagrid. Hence I end up with some of the datagrids with huge empty spaces below the content.

      Here is the code for my custom component

      [code]

      <mx:DataGrid x="20" y="36" showHeaders="false" width="525" id="markSheetSectionDG" wordWrap="true" variableRowHeight="true" editable="true" dataProvider="{markSheet10DGDataAC}" height="100%">
      <mx:columns>

      <mx:DataGridColumn headerText="" dataField="blockTitle" editable="false" />

      <mx:DataGridColumn dataField="blockMark"
      itemRenderer="mx.controls.CheckBox"
      rendererIsEditor="true"
      editorDataField="selected" headerText="" editable="true" width="50" />

      </mx:columns>
      </mx:DataGrid>
      <mx:Text text="{_xmlItem.subTitle}" x="20" y="10" id="subTitle" fontWeight="bold"/>

      [/code]

      And here is the code that displays the repeated custom component

      [code]

      <mx:VBox width="720" height="190" id="markSheetTile">

      <mx:Repeater id="markSheet10NewRepeater" dataProvider="{this.markSheet10XMLData}" >
      <local:MarkSheet10Item id="markSheet10NewItem" xmlItem="{markSheet10NewRepeater.currentItem}">
      </local:MarkSheet10Item>
      </mx:Repeater>
      </mx:VBox>

      [/code]


      Any one any ideas how to display all my content without vertical scrollbars?

      Thanks

      Paul