Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Visible columns in grid

Hi all,

is it possible to determine what columns are in the visible portion of a
grid when leftcolumns=1 when te grid is scrolled to the right.

In a VFP8 app I want to synchronize two grids.
I have two grids in a form. Grid1 containes some details in about 100 records.
I want grid2 to show te sum of the corresponding columns in grid1

When grid1 is scrolled to the right I want grid2 to be scrolled exactly the
same.

In both grids Allowcellselection=.F.

Henri
[521 byte] By [Henri] at [2007-11-10 12:49:14]
# 1 Re: Visible columns in grid
Henri,
Some suggestions:
1. You could add code to the Scrolled event (or a method called from the event) of Grid 1 that calls
the DoScroll method of the second grid with the corresponding parameter.
2. Instead of adding code to Grid 1, create a new object with a Synch method and use BindEvent to
bind to the Scrolled event of Grid 1 and have it call the DoScroll method of Grid 2.

HTH.

--
Larry Miller
MCSD, Microsoft MVP Visual FoxPro
Bifrost Solutions

"Henri" <hvbalkom@pronexus.nl> wrote in message news:3ea4fa7d$1@tnews.web.dev-archive.com...
>
> Hi all,
>
> is it possible to determine what columns are in the visible portion of a
> grid when leftcolumns=1 when te grid is scrolled to the right.
>
> In a VFP8 app I want to synchronize two grids.
> I have two grids in a form. Grid1 containes some details in about 100 records.
> I want grid2 to show te sum of the corresponding columns in grid1
>
> When grid1 is scrolled to the right I want grid2 to be scrolled exactly the
> same.
>
> In both grids Allowcellselection=.F.
>
> Henri
Larry Miller at 2007-11-11 23:51:02 >
# 2 Re: Visible columns in grid
Thanks Larry for your response,

it works fine in case you click:
- left/right arrow on horizontal scroll bar
- area to the left/right of the scroll box

but the problem is that I don't know how you can determine how many times
you should call "grid2.DoScroll" when you drag the scroll box.

Is there anyone who can help with this one?

Henri
Henri at 2007-11-11 23:52:07 >
# 3 Re: Visible columns in grid
Henri,
One other option is to take the horizontal scrollbars away and add your own VCR-like control under
the grid. You could then call the DoScroll method for both grids using the appropriate parameter
when the VCR buttons were clicked.

Regards.

--
Larry Miller
MCSD, Microsoft MVP Visual FoxPro
Bifrost Solutions

"Henri" <hvbalkom@pronexus.nl> wrote in message news:3ea7c6c7$1@tnews.web.dev-archive.com...
>
> Thanks Larry for your response,
>
> it works fine in case you click:
> - left/right arrow on horizontal scroll bar
> - area to the left/right of the scroll box
>
> but the problem is that I don't know how you can determine how many times
> you should call "grid2.DoScroll" when you drag the scroll box.
>
> Is there anyone who can help with this one?
>
> Henri
Larry Miller at 2007-11-11 23:53:11 >