Calculating column widths is not a built-in feature of the framework because it invites people to run code that has to visit every row in the dataprovider.
You can write such code yourself to compute the width of a column if you wish. On 5/21/10 10:39 AM, "method_air" <[email protected]> wrote: Autosizing a datagrids column width to fit the contents of a field is a common feature in other frameworks. Is there a Flex equivalent? --- In [email protected] <mailto:flexcoders%40yahoogroups.com> , Brendan Meutzner <bmeutz...@...> wrote: > > The concept of auto fitting wouldn't really work for the simple reason that > the row children are recycled as the content is scrolled. If you did end up > figuring out the functionality to make this happen from the itemRenderers, > the column width would be constantly changing to "fit" to the currently > viewable set of renderers. > > > Brendan > > > > On Fri, May 21, 2010 at 11:52 AM, method_air <loudj...@...> wrote: > > > > > > > Thanks. Is there a way for the column to intelligently 'autofit' to the > > width of its contents? > > > > > > --- In [email protected] <mailto:flexcoders%40yahoogroups.com> > > <flexcoders%40yahoogroups.com>, "David" > > <dbonnell@> wrote: > > > > > > Set the width on the DataGridColumn, not on its itemRenderer > > > > > > --- In [email protected] <mailto:flexcoders%40yahoogroups.com> > > > <flexcoders%40yahoogroups.com>, > > "method_air" <loudjazz@> wrote: > > > > > > > > How do you vary the data grid column widths? Setting the width property > > inside the item renderers to different values is not working. > > > > > > > > Thanks, > > > > > > > > Philip > > > > > > > > > > > > > > > > > -- > Brendan Meutzner > http://www.meutzner.com/blog/ > http://www.riajobs.com > -- Alex Harui Flex SDK Team Adobe System, Inc. http://blogs.adobe.com/aharui

