I am building an application in WPF for special needs. At first I selected user controls, but later found out that a lot of what I needed was already implemented in Datagrid Control. However, there is one small glitch:
The problem with Datagrid is that it provides a minimum of 2 pixel gaps between two consecutive cells (1 on each side of the grid). Please look at the following diagram for clarity:
. Note the 2-pixel difference set by the Datagrid between two consecutive cells: http://img265.imageshack.us/img265/3545/figurem.png
(Stack overflow did not allow me to add an image to my question with a link to the anti-spam policy for new users)
.
This does not meet my requirement, since I want the content to be displayed “continuously” (there shouldn't be this 2 pixel gap, I want the connecting lines to look “connected”). I tried fidgeting with GridLinesVisibility, but that didn't help. The DataGrid has a custom control, for example:
<DataGrid.Columns> <DataGridTemplateColumn Width="25" Header=""> <DataGridTemplateColumn.CellTemplate> <DataTemplate> <ContentControl Content="{Binding Path=MyCustomControl}" Margin="0"></ContentControl> </DataTemplate> </DataGridTemplateColumn.CellTemplate> </DataGridTemplateColumn> .... </DataGrid.Columns>
I have so far tried:
but nothing appears.
Is there a solution for this / some hack or workaround or will I need to create everything from scratch? I have decent experience with C #, but I'm new to WPF.
Please, help.
source share