Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > Avalon

Vista - Scrolling grid, locking header row

 
 
Old 02-04-2006   #1 (permalink)
Nik Coughlin


 
 

Scrolling grid, locking header row

Hi,

What would be the best approach to take with this problem? I have a grid
that needs to be able to scroll both horizontally and vertically, as it
could conceivably be bigger in than the viewport in either direction.
Please see:

http://nrkn.com/files/images/scrollingGrid.png

The problem is, the header row needs to be fixed. That is, when the grid is
scrolled horizontally, the header moves with the rest of the grid so that
the columns still line up, but when it is scrolled vertically the header
stays put so that it is always visible.

The only thing I can come up was using two grids in a horizontal-only
scrollviewer with SharedSizeGroup for the columns and then putting the
content rows in a vertical-only scrollviewer, problem is that having them
both in the horizontal scrollviewer means having to scroll the the right of
the grid in order to get to the vertical toolbars.

Is there a way to take a ScrollViewer with no visible scrollbars, and link
it to a <scrollbar> elsewhere that then acts exactly like the vertical
scrollbar of the scrollviewer should?



My System SpecsSystem Spec
Old 02-08-2006   #2 (permalink)
Nik Coughlin


 
 

Re: Scrolling grid, locking header row

Nik Coughlin wrote:
> Hi,
>
> What would be the best approach to take with this problem? I have a
> grid that needs to be able to scroll both horizontally and
> vertically, as it could conceivably be bigger in than the viewport in
> either direction. Please see:
>
> http://nrkn.com/files/images/scrollingGrid.png
>
> The problem is, the header row needs to be fixed. That is, when the
> grid is scrolled horizontally, the header moves with the rest of the
> grid so that the columns still line up, but when it is scrolled
> vertically the header stays put so that it is always visible.
>
> The only thing I can come up was using two grids in a horizontal-only
> scrollviewer with SharedSizeGroup for the columns and then putting the
> content rows in a vertical-only scrollviewer, problem is that having
> them both in the horizontal scrollviewer means having to scroll the
> the right of the grid in order to get to the vertical toolbars.
>
> Is there a way to take a ScrollViewer with no visible scrollbars, and
> link it to a <scrollbar> elsewhere that then acts exactly like the
> vertical scrollbar of the scrollviewer should?


private void ScrollChanged(object sender, RoutedEventArgs e){
HeaderRow.ScrollToHorizontalOffset(DataRows.HorizontalOffset);
}


My System SpecsSystem Spec
 

Thread Tools


Similar Threads
Thread Forum
Trying to play GRID....need help please! Gaming
Vertical scrolling...jumps rather than smooth scrolling - Excel 20 Vista hardware & devices


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46