Click here to Skip to main content
15,798,825 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
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?
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

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)

Share this answer

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

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900