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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T13:25:47+00:00 2026-06-01T13:25:47+00:00

I’ve got a WPF ListView that I’m using as a GridView. Is there any

  • 0

I’ve got a WPF ListView that I’m using as a GridView. Is there any way I can get vertical gridlines in there?

The ListView has a MinHeight specified, so I’d like the GridLine to go all the way to the bottom of the grid, so it’ll fill the empty space.

This seems to be a rather tricky problem. Is is possible to solve?

  • 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-01T13:25:49+00:00Added an answer on June 1, 2026 at 1:25 pm

    This is how I do it.

          <ListView Grid.IsSharedSizeScope="True"
                    ItemsSource="{Binding Path=MyList,FallbackValue='12345'}" >
            <ListView.ItemTemplate>
              <DataTemplate>
                <Grid>
                  <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="3*" SharedSizeGroup="col0"/>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="1*" SharedSizeGroup="col2"/>
                  </Grid.ColumnDefinitions>
                  <TextBlock Grid.Column="0" Margin="10,0"
                           Text="{Binding Path=Name, FallbackValue='Name goes here'}"/>
                  <Border Grid.Column="1" Margin="0,-2"
                        BorderBrush="DarkGray" 
                        BorderThickness="0,0,1,0" />
                  <TextBlock Grid.Column="2" Margin="10,0"
                           Text="{Binding Path=DateModified, FallbackValue='Date goes here'}"/>
                </Grid>
              </DataTemplate>
            </ListView.ItemTemplate>
          </ListView>
    

    The SharedSizeGroup and Grid.IsSharedSizeScope properties are key to this way of doing it. The Margin="0,-2" property on the Border makes sure the dividing line looks like a continuous vertical line. If you add vertical margin to the two textblocks, you will need to increase the negative vertical margin of the border.

    This will take care of lining things up into two uniformly sized columns with a vertical line between them, but it won’t extend into areas where there is no data. A ListView might not be the best option if you want that functionality.

    Adding some data to the MyList property in the ViewModel gives this as a result:
    enter image description here

    Of course, the MyList property needs to be a list or collection of a class that has Name and DateModified as properties.

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

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I've got a string that has curly quotes in it. I'd like to replace
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I want to count how many characters a certain string has in PHP, but
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a jquery bug and I've been looking for hours now, I can't
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I have a French site that I want to parse, but am running into

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.