Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to 'freeze pane' in WPF datagrid

Tags:

.net

wpf

datagrid

Is it possible with a WPF datagrid to do like in Excel and Freeze the first few columns so that they always appear

If so how ?

Thanks

like image 503
David Brunelle Avatar asked Aug 24 '11 17:08

David Brunelle


2 Answers

You have the property FrozenColumnCount.
If you set it to 2 for example, then you can scroll the DataGrid horizontally but the first two columns will always be visible

<DataGrid FrozenColumnCount="2" ...>
like image 124
Fredrik Hedblad Avatar answered Sep 21 '22 12:09

Fredrik Hedblad


Try: DataGrid.FrozenColumnCount.

like image 45
Branko Dimitrijevic Avatar answered Sep 22 '22 12:09

Branko Dimitrijevic