PDA

View Full Version : Disable grid vertical scrolling problem



francescoNemesi
29 Dec 2011, 2:50 AM
Hi,

I have a treegrid and I need to disable both horizontal and vertical scrolling on it as the scrolling is performed via code. To disable horizontal scrolling I use


tree.getView().setForceFit(true);

and that works fine. To disable Vertical scrolling I have written this code:



tree.addListener(Events.ViewReady, new Listener<BaseEvent>(){
public void handleEvent(BaseEvent be) {
tree.getView().getScroller().setStyleAttribute("overflow","hidden");
}
});


This works fine in that the scrollbar is not displayed, but the grid still creates the room on the right for the scrollbar even if it is not displayed. See attached image.

How can I avoid this behaviour? I would like the grid to fit the container panel both vertically and horizontally withour ever displating scrollbars.

Thanks

30348

francescoNemesi
29 Dec 2011, 8:28 AM
I have found the solution. I have created my own GridView and overridden the calculateVBar method as per the code below. It works just fine.



@Override
protected void calculateVBar(boolean force) {
this.vbar = false;
layout(true);
}


Regards,
Francesco