Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: WPF grid Scrollbar
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 14:43pm
Comments
darshan_ur at 13-Sep-12 10:46am
   
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

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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
0 Sergey Alexandrovich Kryukov 485
1 BillWoodruff 330
2 OriginalGriff 310
3 Shweta N Mishra 244
4 Mathew Soji 225
0 OriginalGriff 6,153
1 Sergey Alexandrovich Kryukov 5,638
2 DamithSL 4,958
3 Manas Bhardwaj 4,539
4 Maciej Los 3,710


Advertise | Privacy | Mobile
Web04 | 2.8.1411019.1 | Last Updated 16 Sep 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100