Data Grid Shows an additional column
I have a wpf data Grid where I created two columns. But whenever I launch the window, the datagrid shows an extra column. I can't figure out why. Below is my code
<Custom:DataGrid
Background="White"
AlternatingRowBackground="#103D7EC5"
RowHeaderWidth="20"
SelectionMode="Single"
SelectionUnit="FullRow"
GridLinesVisibility="None"
MinRowHeight="30"
EnableRowVirtualization="True"
EnableColumnVirtualization="True"
CanUserAddRows="False"
CanUserSortColumns="True"
AreRowDetailsFrozen="True"
RowDetailsVisibilityMode="Collapsed"
ItemsSource="{Binding CurrentEntity.RefDetails, Mode = TwoWay}" AutoGenerateColumns="False" Name="grdDoctor1" ScrollViewer.VerticalScrollBarVisibility="Auto" MaxHeight="200">
<Custom:DataGrid.RowDetailsTemplate>
<DataTemplate>
</DataTemplate>
</Custom:DataGrid.RowDetailsTemplate>
<Custom:DataGrid.Columns>
<Custom:DataGridTextColumn Binding="{Binding DepId}" Width="100" IsReadOnly="True" Header="Id"/>
<Custom:DataGridTextColumn Binding="{Binding DepData}" Width="100" IsReadOnly="False" Header="Data"/>
</Custom:DataGrid.Columns>
</Custom:DataGrid>
Any guess why this is happening ..?
+2
a source to share
1 answer
Does it have an extra column? Or is it just a row header (the little arrow that appears first in each row)? If this is a header row and you want to get rid of it, set HeadersVisibility to Columns or None
There is a nice image here that shows what the outline of the various parts of the mesh is.
+2
a source to share