Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8160807
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T18:21:37+00:00 2026-06-06T18:21:37+00:00

Say I have a very simple WPF grid (6 rows x 6 columns) defined

  • 0

Say I have a very simple WPF grid (6 rows x 6 columns) defined as follows:

<Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
</Grid.RowDefinitions>

<Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>

I want the following grid lines (one solid line and two dashed lines) drawn as follows (I drew this in Excel so ignore the light Excel grid lines):

enter image description here

How might I go about doing this in XAML?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T18:21:38+00:00Added an answer on June 6, 2026 at 6:21 pm

    You can place Lines at the tops of the required cells, by setting VerticalAlignment="Top", the appropriate Grid.ColumnSpan, and set StrokeDashArray to get the dashed line.

    Edit: The above was just off the top of my head, and I apparently forgot about a few ‘features’ of WPF.

    Here is the sample I got working. I put it in a Grid with 5 rows and columns, star-sized.

    <Line Grid.Row="0" Grid.Column="1" Grid.RowSpan="2" Grid.ColumnSpan="2"
        VerticalAlignment="Center" Stroke="Black" StrokeThickness="1"
        X2="{Binding Path=ActualWidth, RelativeSource={RelativeSource Self}}" />
    <Line Grid.Row="1" Grid.Column="2" Grid.RowSpan="2" Grid.ColumnSpan="2"
        VerticalAlignment="Center" Stroke="Black" StrokeThickness="2" StrokeDashArray="5,3"
        X2="{Binding Path=ActualWidth, RelativeSource={RelativeSource Self}}" />
    

    Note: If rows will vary in size, that won’t work, since it centers the line in the two rows. If they will vary in size, you will need VerticalAlignment="Top", but beware, the top half of the line will be clipped.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's say I have a very simple PrototypeJS class that looks like this: var
Let's say I have the following, very simple block of code: <script> function hasVal(field)
Here is one very simple question(or at least at first sight).Let's say we have
Let's say we have very simple Java class MyClass . public class MyClass {
To keep things very simple, say I have a SQL Server 2008 table with
Very simple math question. Say I have an image with a point being tracked
Lets say that I have a very simple table: <table> <tr> <td>TextFirst</td> <td>TextSecond</td> </tr>
Say you have a very simple data structure: (personId, name) ...and you want to
Say I have a very simple java object that only has some getXXX and
Take a very simple case as an example, say I have this URL: http://www.example.com/65167.html

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.