R – Is it possible to get a custom ItemRenderer to scroll the DataGrid rather than its cell

actionscript-3apache-flexmxml

I'm having an issue with a custom ItemRenderer I've written for a DataGrid. With this ItemRenderer, it's possible that the contents could exceed the width and height of the DataGrid cell – and when this happens, scroll bars appear, letting me scroll the individual cell.

What I would like, however, is that when the contents of the cell are too large, the entire DataGrid scrolls, rather than the individual cells.

Now, when I set the custom ItemRenderer's horizontal and vertical scroll bar policies to "off", I get the vertical scrolling on the DataGrid that I want (the individual cells stretch to accommodate the full height of the contents) but I don't get any horizontal scrolling. Instead, any content too wide for the cell is clipped. Incidentally, setting the DataGrid's horizontal scroll bar policy to "on" has no effect, the scroll bar gutter is drawn, but nothing scrolls

Is there a way to force the DataGrid to scroll horizontally when my custom ItemRenderer's contents are too wide for the cell?

Best Answer

You may have to find a way calculate and expand the size of the DataGrid horizontally in a canvas so that it shows all the cells, and the scrollbar would appear as part of the canvas.

Related Topic