Click here to Skip to main content
11,928,919 members (47,308 online)
Rate this:
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
darshan_ur 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
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)


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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web04 | 2.8.151126.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