Click here to Skip to main content
Sign Up to vote bad
good
See more: WPFgridScrollbar
Is there a way to freeze the first row and first column of a grid (not data grid) in WPF? My application has a grid that contain line chart controls and I would like to have the first row to hold labels that would stay still as I scroll vertically and for the first column to hold labels that stay when I scroll horizontally.
Can anyone share an example on how to do this?
Posted 12 Sep '12 - 13:43

Comments
darshan_ur - 13 Sep '12 - 10:46
While setting up the First row if you fix the height then the scrolling wont update that row height. Same goes for Column.

1 solution

Here is an external link to an article that talks about fixing the first N columns[^].
 
It does happen to use a DataGridView in the Grid, which you said you didn't really want to use, though you didn't say why you didn't.
 
This external article uses xamGrid by Infragistics[^] for the same effect.
 
But the Grid class is not designed to have non-Scrolling columns or rows. That is what DataGrid (or a DataGridView inside a Grid) is for. (and xamlGrid if you are using the Infragistics classes)
 
-Jesse
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 Sergey Alexandrovich Kryukov 409
1 Mahesh Bailwal 353
2 Maciej Los 260
3 CPallini 245
4 Aarti Meswania 173
0 Sergey Alexandrovich Kryukov 9,162
1 OriginalGriff 7,194
2 CPallini 3,923
3 Rohan Leuva 3,176
4 Maciej Los 2,633


Advertise | Privacy | Mobile
Web03 | 2.6.130516.1 | Last Updated 16 Sep 2012
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid