I have a Grid inside a ContentPanel. I want the ContentPanel to expand in height to a certain point before forcing the Grid to scroll; if I set the height of the ContentPanel, it will render at that height even if the Grid is empty, which looks weird. ContentPanel only has setHeight, not setMaxHeight; and, the max-height CSS attribute doesn't appear to trigger scrolling. So, I have the following hack:

Code:
public void onCompleteEdit(CompleteEditEvent<Value> event) {
        store.commitChanges();
        if (panel.getOffsetHeight() > height) {
            panel.setHeight(height);
        }
Every edit event in the grid triggers a check, and scroll bars "turn on" once the grid has sized to the desired length. So while building the initial dataset it works fine; however when initially loading the table already populated with data, I can't find a way to check to see if the height should be set. (I've tried onShowEvent and onResizeEvent; neither are triggered during a normal render.)

Is there a better way to achieve this than my hack? If not, what event can I trigger on?

Thanks