WPat datagrid question

I have a WPF datagrid and it works fine, but I notice some very small column in front of the first column ... I want to delete it ... How to do it?

Take a look at the picture: http://i45.tinypic.com/2d177f9.jpg ... the thing I want to delete is what I surrounded in a red rectangle.

+4
source share
5 answers

This is the title bar. When you click on it, it selects the entire row. By default, it looks like a strange artifact, as you mentioned.

Just set a property like this RowHeaderWidth = "0" and it will disappear, or set it larger to see it better.

+3
source

This is the title of the line, as David Brunelle said. But instead of setting the width to zero, I think a cleaner solution is to set HeadersVisibility="Column" .

+1
source
  <my:DataGrid HorizontalAlignment="Left" Margin="0,0,0,0" Padding="0,0,0,0" Name="softwareTable" Width="542" AutoGenerateColumns="false" CanUserAddRows="False" CanUserDeleteRows="False" IsReadOnly="True" CanUserResizeRows="False"> <my:DataGrid.Columns> <my:DataGridTextColumn Header="Name" Binding="{Binding Path=Name}" Width="182" CanUserResize="False" CanUserSort="False" CanUserReorder="False"></my:DataGridTextColumn> <my:DataGridTextColumn Header="Description" Binding="{Binding Path=Description}" Width="350" CanUserResize="False" CanUserSort="False" CanUserReorder="False"></my:DataGridTextColumn> </my:DataGrid.Columns> </my:DataGrid> 
0
source

You see this at runtime or development time. I put this haml in vs2008 and had no signs of a problem.

0
source

I think you have a problem with the first column. your grid width is 542, and for 182 - for 182, and for the second column - 350. just simple math 350 + 182 = 532

u see 532 not 542

two solutions 1: add 10 to the width of the first column

or

2: reducing 10 over the width of the grid I hope this helps.

-1
source

Source: https://habr.com/ru/post/1301579/


All Articles