09-08-2008 11:14 AM
Hi Mark and All,
Thanks for Reply.
columnHeadingHolder = new HorizontalFieldManager(HorizontalFieldManager.NO_H
| HorizontalFieldManager.NO_VERTICAL_SCROLL | HorizontalFieldManager.USE_ALL_WIDTH){
public void paint(Graphics graphics)
{
super.paint(graphics);
XYRect xy = getExtent();
hieghtVFM = xy.Y2();
}
};
columnHeadingHolder HorizontalFieldManager uses paint() which gets the (x,y) point of this Manager.
dataScroller = new VerticalFieldManager(VerticalFieldManager.VERTICAL
| VerticalFieldManager.VERTICAL_SCROLLBAR ){
protected void sublayout(int width, int height){
super.sublayout(width, height);
//overides the width and height
setExtent(widthVFM, graphics.getScreenHeight()- hieghtVFM);
}
};
dataScroller VerticalFieldManager uses sublayout() which is turn uses setExtent() method.
sublayout() method sets the width and height of visible rows of Grid.
In this process sublayout() method is called first and then the paint() method.
But I want to call first paint() method of HorizontalFieldManager and then sublayout() method.
Is it possible? If yes then how do it.or Is there any other way?
Thanks
09-08-2008 11:16 AM - edited 09-08-2008 11:21 AM
Hi All,
Please give the suggestion. it is urgent, thanks in advance
09-08-2008 12:34 PM
The sublayout a method is called before paint to allow fields and managers to calculate their positions accordingly.
If you need to find the XYRect of a field you can call the getManager().getContentRect() methods on the field itself.
09-11-2008 11:55 AM
Hello Mark and all,
Thanks for your reply,
I tried to use getContentRect() on the Main Manager in sublayout and it returned xy co-oridanate as 0.
I just try to explain my problem once again,
Actually I just want to restrict the height of the Grid Control to some fixed limit let us say upto only 5 rows.
But, when my screen contains some other fields labelField, editfields at top.
And below that if I placed my Grid Control, let's say at middle of screen, first time it looks OK, but when I try to
scroll it vertically, eventually it takes the area of entire screen.
I just dont want this to happen. So, If I am placing my Grid Control at center of screen then when I scroll it vertically
it should go only till 5 rows and its base position should not change, i.e. it should remain at center of screen.
I am using sublayout method here to do this task. But, not able to got it working.
So,I want to get XY co-ordinates of the columnHeadingHolder(according the above code) manager and from that I want
to fix the height of the Grid Control.
Thanks and waiting for your replys....
09-11-2008 04:01 PM
09-12-2008 11:06 AM
Hello Mark,
Thanks for you reply..
I tried to apply the Manager.NO_VERTICAL_SCROLL and Manager.NO_HORIZONTAL_SCROLL style to the Manager which is on top of the Grid Control, but it doesn't work for me, when I try to scroll down in the Grid Control my grid control takes the entire screen and the fields which are on top of the Grid control get disappeared. I just want to fixed the height of Grid Control to some fix limit(let us say upto 5 rows)and when I try to scroll vertically, only 5 rows should be visible at atime in Grid, and rows in Grid should be seen accordingly. I tried to use layout method to fixed the height, but not having success with it.
Can anyone please guide me here?....
Thanks and keenly waitng for you replys....![]()
09-12-2008 04:25 PM
09-15-2008 11:20 AM
Hello Mark,
Thanks for reply.
I am adding GridControl to Manager after that Manager is added to screen.i have no scroll styles in sceeen.
I can not apply the style to screen, I need to apply it in Grid Control itself, it should not depend on the Screen.
So please give me any suggestion
Thanks
09-15-2008 04:22 PM