Thanks again.

Yeah, I tried that as well. But it doesn't return the resized height
but a uniformed height of 18 pixels instead.

Is there no other way to capture the height after it's been drawn? I
have done the following:

var grid1:DataGrid = DataGrid(DataGridListData(listData).owner);
trace(grid1.getExplicitOrMeasuredHeight());

It returns the height of the datagrid.

trace(getExplicitOrMeasuredHeight());

It returns the 18 px height I mentioned earlier and truncates whatever
data that is beyond the 1st line.

I have also tried various other "get" and "measure" methods to no avail.

I may be naive, but is there a way to capture "grid1.[height of each
data cell]" and pass that as argument?

Thanks.

--- In [email protected], "Ben Clinkinbeard"
<[EMAIL PROTECTED]> wrote:
>
> Maybe try 
getExplicitOrMeasuredWidth/Height<http://livedocs.adobe.com/flex/3/langref/mx/core/UIComponent.html#getExplicitOrMeasuredHeight%28%29>()
> in drawRect()
> 
> Ben
> 
> 
> 
> On Thu, May 15, 2008 at 4:10 PM, Shun Chu <[EMAIL PROTECTED]> wrote:
> 
> >   Thanks for your suggestion. I did call the
> > "super.updateDisplayList()". Specifically, I am implementing what's
> > beeing shown here:
> >
> >
http://butterfliesandbugs.wordpress.com/2007/07/11/using-an-itemrenderer-to-change-the-background-of-a-datagrid-cell/
> >
> > I am guessing that the itemRenderer is being overridden with the the
> > "unscaledWidth" and "unscaledHeight" arguments in the "g.drawRect"
> > method. And it's drawing with the unscaled numbers. Is there a way to
> > somehow catch the resized height/width and pass those as arguments
> > instead?
> >
> > Thanks.
> >
> > --- In [email protected] <flexcoders%40yahoogroups.com>,
> > "ben.clinkinbeard"
> >
> > <ben.clinkinbeard@> wrote:
> > >
> > > You need to call super.updateDisplayList() in your override.
> > >
> > > Ben
> > >
> > >
> > > --- In [email protected]
<flexcoders%40yahoogroups.com>, "Shun
> > Chu" <shun.chu@> wrote:
> > > >
> > > > Hi,
> > > >
> > > > I have extended the Label class by overriding the protected method
> > > > "updateDisplayList". The purpose was to allow showing
different cell
> > > > colors in a dataGrid by checking the value of each dataField
(if x >
> > > > 10, fill with green... etc).
> > > >
> > > > Now, the problem is, by overriding the "updateDisplayList"
method, I
> > > > lost the ability to scale the height of each a row when
there's more
> > > > data than the width allows. Or is there another way to do this
without
> > > > affecting the ability to scale?
> > > >
> > > > I am relatively new to Flex, so any useful comments are
appreciated.
> > > > Thank you.
> > > >
> > >
> >
> >  
> >
>


Reply via email to