datagrid.getItemAt() is gone, use following:

for(ver i:int=0;i<dg.columns.length;i++){
    trace(dg.columns[i].width);
}

you will get each column's width (and lot of other properties).

note: what dg.columns[i] returns is of DataGridColumn type, check it in the manual for other props/methods.

jeremy.

On 4/5/06, jameskeepnews <[EMAIL PROTECTED]> wrote:
And thank you, Shweta -- I saw the Macromedia sample on their site
that return ciolumn width, with this syntax you suggest below.
However, when I try to utilize it, I get this compile error in
Eclipse (running Flex 2.0 Beta 2):

"Call to a possibly undefined method 'getColumnAt' through a
reference with static type 'mx.controls:DataGrid '"

Macro-Adobe folks: is this syntax no longer useable within 2.0?

I have since tracked down part of my solution. A script gathers the
width info like so:

var columns:ArrayCollection = new ArrayCollection( mygrid.columns );
var c1 = (columns.getItemAt( 0 ) as DataGridColumn).width;...


...and iterate away. Thanks again to everyone for their help. jk


--- In flexcoders@yahoogroups.com, "shweta_parekh" <[EMAIL PROTECTED]>
wrote:
>
> Hi,
>
> I think if you say
>        dg.getColumnAt(a).width
> will give the width of the column at index a in the datagrid.
> dg being the id of the datagrid.
>
> Hope this helps.
> -Shweta
>
> --- In flexcoders@yahoogroups.com, "jameskeepnews" <jkeepnews@>
> wrote:
> >
> > Thanks, Jeremy -- I am aware of DataGridColumns, which is where
> we're
> > tracking those widths, and I understand what you're describing
in
> > principle. It's the practice I'm looking for... :}
> >
> > Could you (or someone) provide me with a snippet of code as an
> > example? Obliged, jk
> >
> >
> >
> > --- In flexcoders@yahoogroups.com, "jeremy lu" <wade.lu@> wrote:
> > >
> > > >
> > > > So...is there a way to determine the column width of each
> > > > DataGridColumn (probably on creationComplete) every time new
> data
> > > > populates it and send that pixel width somewhere?
> > >
> > >
> > > check out DataGrid.columns, it's an array of all columns so
just
> > iterate
> > > thru it to get the width of each column.
> > >
> > > jeremy.
> > >
> >
>







--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/






--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




Reply via email to