Hi,@Dave Calkins . Welcome Microsoft Q&A.
DataGrid has a FrozenColumnCount
property that freezes specific columns. If you don't want to display the DataGrid's Header, you could use HeadersVisibility="None"
. You can try the code below.
<Window x:Class="DataGridFreezeColumtn.MainWindow"
....
mc:Ignorable="d" Name="window"
Title="MainWindow" Height="450" Width="800">
<StackPanel>
<DataGrid HorizontalContentAlignment="Stretch"
ItemsSource="{Binding People}" Width="{Binding ElementName=window ,Path=Width}" AutoGenerateColumns="False"
HeadersVisibility="None" FrozenColumnCount="1"
FontSize="18pt">
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding Name}" Width="2*" />
<DataGridTemplateColumn Width="*">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Button Content="×" Width="30" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
</StackPanel>
</Window>
The result:
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.