views:

1583

answers:

3

Is it possible to display a multiline string in a Flex DataGridColumn?

i.e. Display:

Text line one.

Text line two.

I've tried putting "\n","\r","
" when storing the string but nothing seems to work.

Currently only "Text line one." is displayed and the rest is hidden in the cell. I would prefer not to use "wordWrap=true" to emulate this behaviour in the cell, but instead be able to manually put in newline breaks (although I could turn on wordWrap to avoid long text from hiding due to cell dimensions). Thanks for any replies.

+1  A: 

you will need to create and itemrenderer and use the mx:Text component. You can then break to a new line using "
", \n, or \r

Shua
Thank you, this works. Takes care of the problem of copying the cell contents too :)
raptors
BTW I had to also set "variableRowHeight=true" in the DataGrid declaration to get multiple lines to display even with the custom renderer. Just FYI to anyone that comes across this.
raptors
+2  A: 

Never mind. Setting "wordWrap=true" and "variableRowHeight=true" seems to work.

raptors
A: