DatagridCell hidden removes vertical gridline

Mar 12, 2009 at 2:07 PM
I have a grid where certain row / column combinations don't make sense (e.g. Number of decimals for a character field).  I have applied a CellStyle trigger to set the Visibility property to Hidden in these cases.  That works fine except that the vertical gridlines are also hidden for these cells.   GridlinesVisibility is a property of the grid, so it makes no sense to remove the grid when what's inside the cell is hidden.  It makes the grid looking like a hockey player whose many fights have cost him some teeth.
Coordinator
Mar 12, 2009 at 7:46 PM
The vertical gridline is drawn by DataGridCell. Hence if one hides DataGridCell the grid line gets hidden. I would suggest you to use ElementStyle/EdidtingElementStyle of DataGridColumn to hide the contents of the cell rather than hiding the cell itself.
Mar 12, 2009 at 11:05 PM
That works.  Feels like a work around and ends up with more XAML but it does work. Thanks for quick response.