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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T00:17:36+00:00 2026-05-13T00:17:36+00:00

I am having a Grid in WPF application. I want to display all the

  • 0

I am having a Grid in WPF application.
I want to display all the text block on the first column in the grid to be aligned to the right.
so I thought I could do it with ColumnDefinition and Style like this:

<Grid>
    <Grid.ColumnDefinitions>
        <ColumnDefinition>
            <ColumnDefinition.Resources>
                <Style TargetType={x:Type TextBlock}">
                    <Setter Property=....../>
                </Style..
.....

But This is is not working
Any idea why?

  • 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-13T00:17:36+00:00Added an answer on May 13, 2026 at 12:17 am

    Is that what you want?

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        <Grid.Resources>
            <Style TargetType="{x:Type TextBlock}">
                <Setter Property="Grid.Column" Value="0" />
                <Setter Property="TextAlignment" Value="Right" />
            </Style>
        </Grid.Resources>
        <TextBlock Text="foo" Grid.Row="0"/>
        <TextBlock Text="bar" Grid.Row="1" />
    </Grid>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Having WPF application with complex UI and want to write CodedUITest scripts for the
Hi I am having a telerik GridView in my WPF application. In that grid
I'm having a small problem. I have this grid with a column: <data:DataGrid ColumnHeaderStyle={StaticResource
In our application, we are having various windows which contain grid and their respective
I'm having a WPF Prism 4 MVVM application. ViewItemControl is used as Navigation Control
I have a WPF data grid and an xmlString and am having problems binding
I am having problem in displaying th Image in viewport3d of wpf. <Grid> <Image
I am having a ListView in wpf which is used to display list of
Hi I am creating my first WPF application that uses Ribbons. The problem I
I am having trouble getting the row of a WPF grid that a textbox

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.