Click here to Skip to main content
11,639,126 members (64,210 online)
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 13: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 Suvendu Shekhar Giri 280
1 Sergey Alexandrovich Kryukov 279
2 Richard Deeming 200
3 CPallini 187
4 PIEBALDconsult 175
0 OriginalGriff 9,081
1 Sergey Alexandrovich Kryukov 8,812
2 Mika Wendelius 7,027
3 Suvendu Shekhar Giri 2,600
4 F-ES Sitecore 2,548


Advertise | Privacy | Mobile
Web02 | 2.8.150728.1 | Last Updated 16 Sep 2012
Copyright © CodeProject, 1999-2015
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