2 Replies Latest reply on Nov 30, 2006 10:43 AM by jfillman

    DataGrid Column Width Issues (Bug?)

      I have a couple datagrid with three columns, one column in each grid has width="50". I've noticed some odd behavior with this. First, in Flex Builder, the width of those columns randomly change in Design view. If I go and change the width setting to something else and back to 50 or refresh the display it goes back to displaying correctly.

      Second, when I actually run the project, it seems that my contraint layout settings expand my 50 pixels significantly. It certainly doesn't evenly split my three columns if I have a width setting, but it is far bigger than 50 pixels.

      These could be completely unrelated, but are both unexpected.
        • 1. Re: DataGrid Column Width Issues (Bug?)
          peterent Level 2
          The issue with Flex Builder might be a bug, I'm not sure.

          When you have horizontalScrollPolicy="off" (the default for the DataGrid), the DG attempt to size all of the columns to fit the width of the DataGrid control. Let's say your DG is 200 pixels wide. If 2 of the columns are 50 pixels, the third will be 100 pixels. If you stretch the DG to 300 pixels, the third column should stretch to make up the difference (200 pixels).

          If you set horizontalScrollPolicy="on" then the DG will use all of the columns' widths.
          • 2. Re: DataGrid Column Width Issues (Bug?)
            jfillman Level 1
            I haven't set the horizontalScrollPolicy, so I'm assuming it's the default. The way you described it is the way I understand it would work, however, it seems that when I use contraint layout to stretch it to nearly 100% across the screen, the 50 pixels is not kept. That one column is certainly narrower that the remaining two columns, but it is far bigger that 50 pixels. It's more like 100 or 150. It's more an annoyance than anything. I have a column with a Checkbox in this disproportionally large column. Visually, it looks odd.