3 Replies Latest reply on May 5, 2011 10:54 PM by Flex harUI

    Datagrid's last column width bug v2

    AleWs

      Re-post here, since the other thread has been ruined.

       

      Hi,
      I have this problem with datagrid:
      Setting horizontalScrollPolicy=ON in order to stretch a column without resizing the others ,

      when I stretch a column, the last column will stretch too, becoming larger, sometimes very large.
      I tried setting resizable=false, and also re-setting its width to the original value when the width change, but nothing works.
      How can I solve this?
      Thanks
      Ale

       

      P.S: You can see an example of this behaviour here (I hope I can link this page)

       

      In the example, choose "horizontalScrollPolicy"=auto, click on "set dataprovider" and then stretch column 6 (1cm is enough)

      You'll see that colum 8 now is much wider than all the other column

      Before stretching col6

      Sorin Datagrid bug Before.jpg

      After stretching col6

      Sorin Datagrid bug After.jpg

       

      Thanks!

        • 1. Re: Datagrid's last column width bug v2
          Flex harUI Adobe Employee

          I think I understand your issue.  The DataGrid always places the left edge

          of a column on the left edge of the DG, displays however many other columns

          fit, then expands the last column so that it stretches all the way to the

          right edge.  Depending on the sizes of the columns to the left of the last

          column, the last column will stretch the entire DG.  I believe in older

          versions of Flex, that column size would stick, but I believe more recent

          versions only use that width temporarily.

           

          Some folks claim to have worked around it by adding a dummy column.

          • 2. Re: Datagrid's last column width bug v2
            AleWs Level 1

            Thanks harUI.

             

            I tried adding a dummy column, but the risult is that I had an empty column that stretches instead of the "previous" last column.

             

            Anyway, I don't understand why this last column has to strecth.

            If my datagrid has a width of 200px, I stretch the 2nd column from 50px to 70px, my new datagrid's width should be 220, so the last column shouldn't stretch.

            But it stretches!

            • 3. Re: Datagrid's last column width bug v2
              Flex harUI Adobe Employee

              It's just the way the code works.  Because the column is always

              left-aligned, if we didn't stretch, there could be dead space on the right

              not covered by a column.  If you resize the DG appropriately, the column

              should stop stretching.  By default, I don't think resizing columns changes

              the layout width of the DG.