6 Replies Latest reply on Feb 4, 2009 7:20 PM by Newsgroup_User

    DataGrid Not Resizing to Dynamic Content

    bfargo
      Hello,
      I'm using Flex 3.2. I have an editable DataGrid with no with and height specified. I do specify rowCount to something like rowCount="dataProvider.length". Everything looks good when the datagrid is first rendered with data in it. However, if the data in it changes after rendering, then the grid doesn't resize accordingly. Actually the grid may resize, but the border/frame doesn't.
      Example:
      I have a special TextArea component that grows (vertically) as the user types in more lines of text. I use this component as one of my item editors. If a cell is first rendered with only one line of text, then the user goes in and types additional lines, the grid row grow within it's border, but the not the border itself... causing some undesired scrollbars.

      I need a way to tell the datagrid to re-calibrate sizing just like it does when it's first created. Is there a way to do this? I tried datagrid.invalidateSize() and related procedures, but nothing happens. What do you think?

      Thanks
        • 1. Re: DataGrid Not Resizing to Dynamic Content
          bfargo Level 1
          Ok, I'll try another way. Is there a simple command to force a datagrid to reevaluate its content and resize accordingly?
          • 2. Re: DataGrid Not Resizing to Dynamic Content
            Level 7

            "bfargo" <webforumsuser@macromedia.com> wrote in message
            news:glnlpp$4hi$1@forums.macromedia.com...
            > Ok, I'll try another way. Is there a simple command to force a datagrid
            > to reevaluate its content and resize accordingly?

            Try validateNow()


            • 3. Re: DataGrid Not Resizing to Dynamic Content
              bfargo Level 1
              Thanks a bunch for the suggestion. Unfortunately, that doesn't seem to do anything either. Any idea why that would be? Or any other suggestion?

              Thanks
              • 4. Re: DataGrid Not Resizing to Dynamic Content
                bfargo Level 1
                In fact, this whole string of commands does absolutely nothing...
                this.grid.invalidateDisplayList();
                this. grid.invalidateList();
                this. grid.invalidateSize();
                this. grid.validateNow();
                this. grid.validateDisplayList();
                this. grid.validateSize(true);
                this. grid.validateNow();
                • 5. DataGrid Not Resizing to Dynamic Content
                  bfargo Level 1
                  I finding this datagrid sizing to be extremely frustrating as compared to HTML tables. I just want it to look good. Anytime I do anything with dynamic content, it doesn't size right, or I end up with a bunch of ugly scrollbars, etc. I just want to be able to add some content, and have the datagrid grow with it.. at least in height.
                  VariableRowHeight is set to true, I try setting rowcount to my dataprovider length. Event though the length may be 5, it'll randomly throw a bunch of other rows in there. The behavior is just completely incoherent (at least to me). Nobody else has these kinds of problems? .
                  • 6. Re: DataGrid Not Resizing to Dynamic Content
                    Level 7

                    "bfargo" <webforumsuser@macromedia.com> wrote in message
                    news:gmcsal$34d$1@forums.macromedia.com...
                    >I finding this datagrid sizing to be extremely frustrating as to say, HTML
                    > tables. I just want it to look good. Anytime I do anything with dynamic
                    > content, it doesn't size right, or I end up with a bunch of ugly
                    > scrollbars,
                    > etc. I just want to be able to add some content, and have the datagrid
                    > grow
                    > with it.. at least in height.
                    > VariableRowHeight is set to true, I try setting rowcount to my
                    > dataprovider
                    > length. Event though the length may be 5, it'll randomly throw a bunch of
                    > other rows in there. The behavior is just completely incoherent (at
                    > least to
                    > me). Nobody else has these problems? .

                    Post code