2 Replies Latest reply on Dec 5, 2008 7:35 AM by Ansury

    Adding scrollbars to a datagrid - Should be simple

    Abobo
      Flex 3.

      I would have thought this would simply be an option.

      After looking around I have added:
      horizontalScrollPolicy="auto"

      My code looks like this:

      <mx:Canvas x="501" y="0" width="288" height="516" backgroundColor="#E8EEF7">
      <mx:TextInput x="10" y="11" width="268" id="sd_channel_filter"/>
      <mx:DataGrid id="dg_channels" x="10" y="41" width="268" height="465"
      dataProvider="{channelListFilteredXML.CItem}"
      headerRelease="{headerColor(event)}"
      horizontalScrollPolicy="auto"
      dragEnabled="true"
      itemClick="onItemClick(event)"
      >
      <mx:columns>
      <mx:DataGridColumn headerStyleName="title" width="100" headerText="CHANNELS" dataField="@Name"/>
      </mx:columns>
      </mx:DataGrid>
      </mx:Canvas>

      The problem is this.
      The canvas has 1 TextInput (to filter the datagrid) and the datagrid.

      The datagrid has only 1 column which is populated by an HTTPService request.

      The data in the column is much wider than what is available in the canvas.
      I want a scrollbar to magically appear when the data is added.
      If I set:
      horizontalScrollPolicy="on"

      The scrollbar is there, but it is disabled. Which I think tells me it doesn't need to scroll (i.e. the contents fit the displayable space), but you can clearly see the data is cut off and can't read the rest.

      All my googling found conditions to get rid of scrollbars, not much to add them.

      Any suggestions?

      Thanks,
      Dave