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

  • Home
  • SEARCH
  • 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 924125
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T19:17:51+00:00 2026-05-15T19:17:51+00:00

By default, text is centered in the headers of a ListView ( not in

  • 0

By default, text is centered in the headers of a ListView (not in the content cells!), I’ve been struggling to make it left aligned, here’s what I’ve come up with:

<ListView.Resources>
    <DataTemplate x:Key="Templ">
       <TextBlock HorizontalAlignment="Left" Text="{Binding}"/>
    </DataTemplate>
</ListView.Resources>   
...
<GridViewColumn HeaderTemplate="{StaticResource Templ}">File</GridViewColumn>

This does seem to be the right place to alter the appearance of the header, since I can change other properties like Margin, etc., yet it does not respond to the HorizontalAlignment property! I’m guessing the textbox is sized to content and itself centered, thus making the alignment property redundant.

How can I make the text left aligned ?

  • 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-15T19:17:52+00:00Added an answer on May 15, 2026 at 7:17 pm

    Set the HeaderContainerStyle to a style that sets HorizontalContentAlignment to left:

    <ListView.Resources>
        <DataTemplate x:Key="Templ">
            <TextBlock HorizontalAlignment="Left" Text="{Binding}"/>
        </DataTemplate>
        <Style x:Key="HeaderStyle" TargetType="GridViewColumnHeader">
            <Setter Property="HorizontalContentAlignment" Value="Left"/>
        </Style>
    </ListView.Resources>
    <ListView.View>
        <GridView>
            <GridView.Columns>
                <GridViewColumn HeaderTemplate="{StaticResource Templ}" HeaderContainerStyle="{StaticResource HeaderStyle}">File</GridViewColumn>
            </GridView.Columns>
        </GridView>
    </ListView.View>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to be able to have default text like Enter content here... appear
When I make a text field first responder it deletes my default text. I
I am not able to set default text for @HTML.TextAreaFor This is all I
I want to set some default text in background of control (e.g. TreeView, ListView,
I have a inputbox that displays a default text Input Network ID Here.... I
I'm trying to make all textareas remove default text on focus, except those of
How to set blank default text on input field and clear it when element
I need to place default text to all rows for particular column in jquery
I've set MacVim as my default text editor, and when I double click files
Is it possible to change the default text (something like looking for other iPhones

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.