Here is a sample app:
<?xml version="1.0" encoding="utf-8"?>
<!-- DataGrid showing Array of Objects dataProvider,
multiline content with {newline} and "\n", addItem, and
variableLineHeight -->
<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml">
<mx:Script><![CDATA[
/***************************************************************
uses addItem and "\n" to add an item to the datagrid's dataProvider
on the dataGrid initialize event.
*/
private function initDg(oEvent):Void
{
var dgLit:mx.controls.DataGrid = oEvent.target;
var dpLit:Object = dgLit.dataProvider;
dpLit.addItem({name:"emily", text:"I think that I shall
never see\na poem lovely as a tree"} )
}//initDg
]]></mx:Script>
<mx:Array id="dpTest">
<mx:Object name="hamlet" text="To be or not to be, that
is the question.{newline}Whether 'tis nobler in the mind to
suffer{newline}the slings and arrows of outrageous fortune,{newline}or
to take arms against a sea of troubles,{newline}and by opposing, end
them." />
<mx:Object name="jabberwocky" text="Twas brillig and the
slithy toves did gyre and gimbal in the wabe. All mimsey were the
borogoves and the mome rath outgrabe." />
</mx:Array>
<mx:DataGrid id="dgSource" dataProvider="{dpTest}"
wordWrap="true"
variableRowHeight="true"
initialize="initDg(event)"
rowCount="3"
height="200"
headerHeight="30" >
<mx:columns>
<mx:Array>
<mx:DataGridColumn headerText="Data{newline}Name"
columnName="name" width="150"/>
<mx:DataGridColumn headerText="Text" columnName="text"
width="300" wordWrap="true"/>
</mx:Array>
</mx:columns>
</mx:DataGrid>
</mx:Application>
-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Tracy Spratt
Sent: Thursday, May 26, 2005 7:01 PM
To: [email protected]
Subject: RE: [flexcoders] I need assistance with datdgrid row height.
Did you also set wordWrap="true" on the appropriate DataGridColumn?
Tracy
-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of ryan99899
Sent: Thursday, May 26, 2005 5:43 PM
To: [email protected]
Subject: [flexcoders] I need assistance with datdgrid row height.
I am loading search results in a datagrid and I need to make the row
heights automatically change based on the length of the text.
variableRowHeight is not getting the job done. The problem may lie in
the cell renderer but I need a suggestion to fix this.
Thanks
ryan
Yahoo! Groups Links
Yahoo! Groups Links
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/