Collapse markup borders |
Post Reply |
Author | |
znakeeye
Senior Member Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
Posted: 27 August 2008 at 8:06am |
If I set BorderThickness='1', the outer borders are indeed 1 pixel wide. However, where two grid items meet, the border becomes 2 pixels wide.
In HTML you would fix this with "border-collapse", but I can't find this in your markup implementation.
How would you accomplish this with XTP 12.0.1?
|
|
ABuenger
Newbie Joined: 02 February 2006 Status: Offline Points: 1075 |
Post Options
Thanks(0)
|
12.0.1? 12.0.2 has just been released, so surely you meant 12.1.0 |
|
Codejock support
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
Can you show full markup to try it. I don't see 2 pixels.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
znakeeye
Senior Member Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
|
No, I meant 12.0.1 since I want to accomplish this right now! :P
The inner borders are "doubled". It would be nice if you could "collapse" them to 1 pixel, just like you do in CSS/HTML!
------------------Markup-----------------
<StackPanel Background='#e4ecf7'>
<Grid Margin='4'> <Grid.ColumnDefinitions> <ColumnDefinition/> <ColumnDefinition/> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition/> <RowDefinition/> </Grid.RowDefinitions> <Border Padding='5, 0, 0, 5' BorderThickness='1' BorderBrush='Black' Grid.Column='0' Grid.Row='0'><TextBlock TextAlignment='Left' FontWeight='Bold'>Test</TextBlock></Border> <Border Padding='5, 0, 0, 5' BorderThickness='1' BorderBrush='Black' Grid.Column='1' Grid.Row='0'><TextBlock TextAlignment='Left'>1234</TextBlock></Border> <Border Padding='5, 0, 0, 5' BorderThickness='1' BorderBrush='Black' Grid.Column='0' Grid.Row='1'><TextBlock FontWeight='Bold'>Test</TextBlock></Border> <Border Padding='5, 0, 0, 5' BorderThickness='1' BorderBrush='Black' Grid.Column='1' Grid.Row='1'><TextBlock>1234</TextBlock></Border> </Grid> </StackPanel> |
|
jimmy
Senior Member Joined: 11 November 2003 Location: Austria Status: Offline Points: 515 |
Post Options
Thanks(0)
|
You can play with Margin.
<StackPanel Background='#e4ecf7'> <Grid Margin='4'> <Grid.ColumnDefinitions> <ColumnDefinition/> <ColumnDefinition/> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition/> <RowDefinition/> </Grid.RowDefinitions> <Border Padding='5, 0, 0, 5' BorderThickness='1' BorderBrush='Black' Grid.Column='0' Grid.Row='0'><TextBlock TextAlignment='Left' FontWeight='Bold'>Test</TextBlock></Border> <Border Padding='5, 0, 0, 5' BorderThickness='1' BorderBrush='Black' Grid.Column='1' Grid.Row='0'><TextBlock TextAlignment='Left'>1234</TextBlock></Border> <Border Margin="0,-1,0,0" Padding='5, 0, 0, 5' BorderThickness='1' BorderBrush='Black' Grid.Column='0' Grid.Row='1'><TextBlock FontWeight='Bold'>Test</TextBlock></Border> <Border Margin="-1,-1,0,0" Padding='5, 0, 0, 5' BorderThickness='1' BorderBrush='Black' Grid.Column='1' Grid.Row='1'><TextBlock>1234</TextBlock></Border> </Grid> </StackPanel> Jimmy |
|
ABuenger
Newbie Joined: 02 February 2006 Status: Offline Points: 1075 |
Post Options
Thanks(0)
|
CSS/HTML is not the reference here, have you tried your markup in Blend? |
|
Codejock support
|
|
znakeeye
Senior Member Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
|
I'm not saying the markup result is wrong. I'm saying I want the damn borders to become 1 pixel wide and I KNOW it is possible, because this is Microsoft we're talking about ;)
So, HOW do you accomplish this?
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hello,
They are not double - its borders from left and right border.
You can use margins or don't set bottom border for top cells:
<Border Padding='5, 0, 0, 5' BorderThickness='1, 1, 0, 0' BorderBrush='Black' Grid.Column='0' Grid.Row='0'><TextBlock TextAlignment='Left' FontWeight='Bold'>Test</TextBlock></Border>
<Border Padding='5, 0, 0, 5' BorderThickness='1, 1, 1, 0' BorderBrush='Black' Grid.Column='1' Grid.Row='0'><TextBlock TextAlignment='Left'>1234</TextBlock></Border> <Border Padding='5, 0, 0, 5' BorderThickness='1, 1, 0, 1' BorderBrush='Black' Grid.Column='0' Grid.Row='1'><TextBlock FontWeight='Bold'>Test</TextBlock></Border> <Border Padding='5, 0, 0, 5' BorderThickness='1, 1, 1, 1' BorderBrush='Black' Grid.Column='1' Grid.Row='1'><TextBlock>1234</TextBlock></Border> |
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
znakeeye
Senior Member Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
|
Thanks for your answer. I know I can do the above, but it yields "unclean" code.
No other solution? :P
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |