I have a grid with rowHeight set to 20 which consumes most of the height of my form. Under certain circumstances, I need to reduce the height of the DataGrid itself. At that point, I would prefer the font and rowHeight of the DataGrid to remain the same, resulting in simply a display of fewer rows. Instead, the DataGrid's height reduces, but along the way the rowHeight and font are inappropriately shrunken along with it. The code is as follows: myDataGrid._height = 200; myDataGrid.rowHeight = 20; After changing the _height from 400 to 200 (which works fine), it's as though the subsequent call to reset the rowHeight to 20 has no effect. Any suggestions?
Try this as a test. Apply all your formatting after all the data is loaded and bound. Let me know if that works better. I've played with the component extensively and it certainly has some quirks. Right now I'm trying to fogure out a good way of getting data to autoflow to the next line without getting cut-off. Kind of problematic. -Rob
Thanks for the suggestion, but I found an alternative fix -- instead of changing the _height property of the component, I used the setSize (width, height) function call which is found in the UI base classes. That did the trick. Of course, I have no idea why setSize is preferred to changing the _height or _width, but I'll chalk it up to the MX 2004 learning curve and move on. My next grid challenge is programatically scrolling the grid (via actionscript) so that a specific row is positioned where I want it. I'll plow around for a few more days before posting, but if anyone has suggestions on that, I'd be appreciative. Thanks.
setSize() is for the overall size of the component itself. That woudn't have any effect on the individual rows. I thought that was what you wanted to change. I'm interested in hearing your solution to having the dataGrid start at a particular row. Keep me posted. -Rob
Don't see what you're looking for? Try a search.
|