Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Container on top of Grid Display Issues

Status
Not open for further replies.

stanlyn

Programmer
Sep 3, 2003
945
US
Hi,

I'm having 2 display issues.

The first one is a column that contains only a checkbox is transparent allowing the objects behind it to show through. I've included a screenshot that shows it. I made the column wider to really show the issue.

[link] [/url]


Now the other concerning a container.

I have a container that sits ontop of the grid whenever a checkbox in the grid is checked. It calculates the total of all checked items. All of that works. The problem occurs when scrolling the grid with the mouse wheel, as it starts duplicating the container up the page in one direction, or off the page in the other direction. Take a look at this screenshot...

[link] [/url]


And this is what it should look like...

[link] [/url]


Thanks, Stanley
 
1. Problem: I never put a grid on top of any other controls. To have a background, why not put the grid inside a container and add and display both
2. Problem how about using the Grid.Scrolled event? Thisform.Cls() in there should cause a redraw.

Bye, Olaf.
 
Hi Olaf,

>> 2. Problem how about using the Grid.Scrolled event? Thisform.Cls() in there should cause a redraw.

That helped. It still scrolls the container up, but now it clears it back off leaving the container where it should be with lots of flickering of the yellow container as it moves up and down. Without the cls() the container replicated itself...

It behaves perfectly when using the slider, with no flickering or movement of the container.

Stanley
 
I think there is a column property for you checkbox that needs to be set:

Thisform.mygrid.column1.check1.backstyle = 1 && opaque

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are not good for you.
 
Griff, good idea, but I fear that'll only care about a small area around the checkbox square and not the whole cell. It already seems to be opaque a few pixels around the square.

Stanley, I fear there is nothing you can do about the flickering via mosewheel scrolling, scrolling the curren graphics and only drawing new rows is the way thegrid works. There is no event before mousewheel in which you could hide the container until the Scrolled() event occurs. You might try something in the MouseWheel event, of course. I'd say it occurs after the grid already scrolled, so it does not help any more than the general Scrolled event does, bt that of course only hans the aftermath of the way the grid is drawn. Cls() forces a redraw and then every visible row gets drawn again.

Bye, Olaf.
 
Stanley,

I'm sorry I can't offer any suggestions to add to the good advice you have already been given. But I am wondering if it is really important to show the totals superimposed on the grid. You could avoid the problem completely by showing the same information in a set of labels placed directly on the form (unless I've misunderstood what you are trying to achieve). True, it might not look as nice, but if all else fails ....

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
I just put a few things on top of a grid and the reason it's no problem for using the scrollbar is, that only redraws once ofter you release the bar and it causes all rows to redraw even if you only scroll a bit. Mousewheel cuases many scroll events, which each scroll about 2~3 rows. The way the grid scrolling is implemented nobody thought about anyone putting anything on top of it.

I don't see any chance to avoid the flickering without any firther events to hook into.

Bye, Olaf.
 
Olaf, I took your container idea and fixed both issues. The cls() was way too painfull and slow.

I created a container and added the grid and the totals container within. If there are no checkboxes checked the grid fills the whole container. As soon as a checkbox is checked, the grid's height is reduced to allow the totals container to sit underneath the grid, therefore fixing the scrolling issue.

Placing the grid in the container also fixed the tranparency issue with the checkbox control added to the grid as there are no other controls between the grid and the container it sits in.

So, it appears that these two issues must be worked around. I was wondering if I was missing something here.

Thanks, Stanley
 
I think you made the best of it considering the circumstances. The only thing I wouldn't perhaps do is make the grid height shrink, I'd put the info container under the grid rightaway. If you really need the space it's a sign your form is packed with too much anyway, but that's also a matter of taste and oppinion.

A form you add on top of a grid works, it needs alwaysontop=.t. to keep it in front. Obviously it should have no titlebar and border, also it has to move along, if the form moves, which can be done by bindevents. Anyway, you hide some of the grid rows and columns and the user needs to scroll to see the hidden part of the grid, so I don't see the big benefit of positioning this info there. A footer area under the grid is the natural place for summary information.

Bye, Olaf.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top