Skip to main content
Home Forums Silverlight Programming Silverlight Controls and Silverlight Toolkit How to hide row header in DataGrid?
3 replies. Latest Post by CodeLord on October 12, 2008.
(0)
CodeLord
Member
0 points
4 Posts
10-10-2008 11:34 AM |
Dear colleagues,
I need to have DataGrid without row headers at all. I tried attribute HeadersVisibility="Column", but a gap in front of first column in grid header remains. How to kill this gap and completely hide row headers?
xusun
Participant
1015 points
167 Posts
10-10-2008 4:50 PM |
I didn't see the gap if I set HeadersVisibility="Column". Did you do anything else on the style/template? Could you post a picture if possible?
Thanks,
10-12-2008 2:15 AM |
Nothing special with styles, I create a new project, place grid on the page and set HeadersVisibility="Column". There is a small white empty space between border and grid header row (left side). Right side of the header is correct.
Here is an example, simple default project with default grid. Look at the left side of header row between grid left border and word "value":
http://silverlight.services.live.com/invoke/81060/GridTest/iframe.html
10-12-2008 4:17 AM |
Now I solved the problem by changing grid template in App.xaml.There is a child element TopLeftHeaderTemplate there. I set it's Visibility=Collapsed and the gap disappeared.
Not very elegant, but it works. Maybe better solution exists?