Data Grid Shows extra column
I have a wpf data Grid where I created twlo columns. But whenever I run the window the datagrid shows a 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>
开发者_C百科 <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 suggestion why this is happening..?
alt text http://www.freeimagehosting.net/image.php?0f9496e69e.png][img]http://www.freeimagehosting.net/uploads/th.0f9496e69e.png
Does the extra column have data in it? Or is it just the Row Header (A little arrow that appears first in each row)? If it is the rowheader and you want to get rid of it then set HeadersVisibility to "Columns" or "None"
There is a nice image here which shows what an outline of the different parts of the grid.
精彩评论