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 3788296
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T11:58:35+00:00 2026-05-19T11:58:35+00:00

How would I set a custom grid line style on just one column of

  • 0

How would I set a custom grid line style on just one column of a DataGrid? In particular, I’d like one column to have a double line as its left border.

Example:

| Col1 | Col2 || Col3 (w/ Double Left Border) |

Thank you,
Ben

  • 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-05-19T11:58:36+00:00Added an answer on May 19, 2026 at 11:58 am

    It depends on where you want this double line. The vertical GridLines is drawn in OnRender for DataGridCell and the horizontal GridLines is drawn in OnRender for DataGridCellsPresenter. The border for the DataGridColumnHeader is more complicated however. It’s a Rectangle that’s drawn in the RenderTheme method in DataGridHeaderBorder and I don’t think that there is a direct way to change its width without re-templating the entire DataGridColumnHeader. Also, the border thickness for the Headers are twice as thick as the Cells in the DataGrid to begin with (1px vs 2px), because the Headers draw their Separators on both sides.

    So, to get double line thickness which just affects the Cells you can add a special DataGridCell style where you want this to apply. All this cellstyle does is to draw a 1px border to the left in the same colour as the GridLines. It’ll look something like this

    alt text

    <DataGrid ...
              HorizontalGridLinesBrush="Black">
        <DataGrid.Resources>
            <Style x:Key="DoubleLeftBorderCell" TargetType="DataGridCell">
                <Setter Property="BorderThickness" Value="1,0,0,0"/>
                <Setter Property="BorderBrush" Value="{Binding ElementName=dataGrid, Path=HorizontalGridLinesBrush}"/>
            </Style>
        </DataGrid.Resources>
        <DataGrid.Columns>
            <DataGridTextColumn Header="Double left Border"
                                CellStyle="{StaticResource DoubleLeftBorderCell}"
                                Binding="{Binding TextProperty}"/>
        </DataGrid.Columns>
    </DataGrid>
    

    There is no mouseover effect or anything on the cells to worry about. If you do something similar for a DataGridColumnHeader however, you’ll lose the sorting arrows, mouseover effect, mousedown effect etc. so a you’ll have to create an entire template for it

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

Sidebar

Related Questions

I would like to set some vim options in one file in the comments
I would like to have my warnings set to the highest level using Microsoft
I have a 3-leveled hierarchy of entities: Customer-Order-Line, which I would like to retrieve
I have a gridview that has its DataSourceID property set to a custom ObjectDataSource
I would like to set the log file name for a log4j and log4net
I would like to set some initial variables (like format compact and the current
I would like to set up some WMV Video Streaming, using Windows 2003's Streaming
I am setting up a LAMP server and would like to set Apache's umask
I'm using 960 grid system to create a layout prototype. I would like to
Im currently creating a custom control (based on the WPF DataGrid). What i would

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.