Flex 3 DataGrid Column Width Problem

后端 未结 4 556
执笔经年
执笔经年 2020-12-20 05:18

I\'m pulling xml data to determine which columns are visible, and the widths of each column. My datagrid\'s width can change sinces its on one side of a HDividedBox. The vis

相关标签:
4条回答
  • 2020-12-20 05:53

    Ok - we've run into this ourselves while building support for various column width modes. Just a little tidbit of information - if you want to set widths explicitly, make sure you do something like this:

    var oldPolicy:String = grid.horizontalScrollPolicy;
    grid.horizontalScrollPolicy ="on"
    //set your widths here
    grid.horizontalScrollPolicy =oldPolicy;
    
    0 讨论(0)
  • 2020-12-20 05:54

    My datagrid's width can change sinces its on one side of a HDividedBox.

    That's the problem right there.

    I faced the exact same problem with Flex 2 and Flex 3 DataGridColumn width's whenever the width for the DataGrid was not fixed. The only solution I had was to fix the width of the DataGrid or switch to AdvancedDataGrid or other similar components.

    0 讨论(0)
  • 2020-12-20 06:01

    I have done the same thing in AdvancedDataGrid and it works. Try by setting these values

      horizontalScrollPolicy="on"
      width="100%
    

    and then add you columns this should work with HDividedBox.

    0 讨论(0)
  • 2020-12-20 06:06

    You can accomplish this, it's what I believe is a bug in the DataGrid itself.

    If you set minWidth="0" and horizontalScrollPolicy="{ScrollPolicy.AUTO}" on the DataGrid, you can then create DataGridColumn Objects with fixed widths and have it be obeyed properly.

    However, there seems to still be an issue with the final column, when the DataGrid is still larger then the sum of all of the fixed widths, it will stretch the final DataGridColumn out.

    You could get around this by adding a blank column at the end with no header text etc.

    0 讨论(0)
提交回复
热议问题