DataGrid for WPF and Silverlight Overview > DataGrid Features > Freezing |
Users can freeze columns at run time to prevent them from being scrolled horizontally. This is useful as it keeps specific columns visible when the grid is resized or scrolled. The freeze bar enables users to freeze columns. When visible, the freeze bar appears to the left of the first columns by default:
To freeze specific columns, move the freeze bar to the right of the column(s) you want to freeze. For example, in the following image the freeze bar was moved to the right of the second columns:
Once columns are frozen, they are not scrolled when the grid is scrolled horizontally. For example, in the following image the first two columns are frozen:
Note that the ShowVerticalFreezingSeparator property must be set to Left (by default None) for the freeze bar to be visible and the CanUserFreezeColumns property must be set to Left (by default None) to allow users to freeze columns are run time. See Enabling Column Freezing for an example.