Print Page | Close Window

Collapse markup borders

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=11989
Printed Date: 11 June 2024 at 11:23pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Collapse markup borders
Posted By: znakeeye
Subject: Collapse markup borders
Date 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?



Replies:
Posted By: ABuenger
Date Posted: 27 August 2008 at 6:24pm
Originally posted by znakeeye znakeeye wrote:

How would you accomplish this with XTP 12.0.1?


12.0.1? 12.0.2 has just been released, so surely you meant 12.1.0



-------------
Codejock support


Posted By: Oleg
Date Posted: 28 August 2008 at 1:29am
Hi,
Can you show full markup to try it. I don't see 2 pixels.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: znakeeye
Date Posted: 28 August 2008 at 4:18am
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>


Posted By: jimmy
Date Posted: 28 August 2008 at 5:22am
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



Posted By: ABuenger
Date Posted: 28 August 2008 at 5:58am
Originally posted by znakeeye znakeeye wrote:

The inner borders are "doubled". It would be nice if you could "collapse" them to 1 pixel, just like you do in CSS/HTML!


CSS/HTML is not the reference here, have you tried your markup in Blend?



-------------
Codejock support


Posted By: znakeeye
Date Posted: 28 August 2008 at 7:17am
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?


Posted By: Oleg
Date Posted: 28 August 2008 at 7:31am
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


Posted By: znakeeye
Date Posted: 28 August 2008 at 7:36am
Thanks for your answer. I know I can do the above, but it yields "unclean" code.
 
No other solution? :P



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net