Sunday, March 28, 2010

Datagrid within Datagrid - Rows not...

Hi,

I have a datagrid with a custom item renderer that renders another data grid... so one column will render datagrids within the outer datagrid.?The problem is that the row does not size to fit the inner datagrid.?I can't set the rowHeight on the outer datagrid because the inner datagrids have dynamic data and i don't know how many rows they will have.?Also, after the datagrid is rendered, more rows may be added to any number of inner datagrids at a later time... and I need the rows holding them to resize accordingly. Setting variableRowHeight=true on the outer grid doesn't seem to help either.

Any ideas on how to do this??

Thanks!

Datagrid within Datagrid - Rows not...

DataGrid defaults to 7 rows. You'll have to set the rowCount on the inner grids at some point, then it should get taller as long as variableRowHeight is true on the outer grid.

Alex Harui

Flex SDK Developer

Adobe Systems Inc.

Blog: http://blogs.adobe.com/aharui

Datagrid within Datagrid - Rows not...

Hi, Alex, thanks for the info. It turns out, I was wrong.?The way it looked made me think it was a row-resizing problem, but it turns out that the rows were resizing fine... it was the outer datagrid itself that was not resizing properly.?Apparently it has to do with the combination of variableRowHeight and rowCount.?The jira issue may look familiar to you.

http://bugs.adobe.com/jira/browse/SDK-13507

Anyway, I got this from the jira comments and works pretty good...

height=''{theGrid.measureHeightOfItems(-1, theGrid.dataProvider.length + 1)}''

I also have to call similar code when the data provider of the inner grids add/remove items.

Thanks!

No comments:

Post a Comment