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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T13:18:15+00:00 2026-06-12T13:18:15+00:00

I have the most annoying problem with Visual Studio 2012 and WPF I was

  • 0

I have the most annoying problem with Visual Studio 2012 and WPF I was hoping to get some help with. I have a simple Grid with child elements, say, TextBlocks, with the grid’s cells. The TextBlocks are setup to be positioned RELATIVELY within the cell (using HorizontalAlignment of Left, for example). Everything is fine until I dare to resize its column or row of the Grid. Visual Studio then inserts Margin and Width/Height attributes in keeping with the resulting positions of parent/child elemnts. This all happens silently and I don’t notice it until later if I decide to reduce the size of the column further, all of the sudden the TextBlock gets clipped, due to its Margin attributes that were inserted. I have to go through every child element and remove these extra attributes manually. I have had to do this close to 100 times on my current project, and I cannot find anything on the web to figure out how to tell Visual Studio to BACK OFF and stop taking these liberties that steal the nice formatting I’m trying to achieve.
Here’s a code snippet for reference. But this has happened on many different instances of Grids in my project.

<Grid  Canvas.Left="435" Canvas.Top="138" Height="61" Width="192">
    <Grid.ColumnDefinitions>
        <ColumnDefinition Width="11*"/>
        <ColumnDefinition Width="21*"/>
    </Grid.ColumnDefinitions>
    <Grid.RowDefinitions>
        <RowDefinition Height="1*"/>
        <RowDefinition Height="1*"/>
    </Grid.RowDefinitions>

    <TextBlock Grid.Row="0" Grid.Column="0" Text="Subtotal:" HorizontalAlignment="Right" VerticalAlignment="Center"  />
</Grid>

… and after the resizing of column 0:

<TextBlock Grid.Row="0" Grid.Column="0" Text="Subtotal:" HorizontalAlignment="Right" VerticalAlignment="Center" Height="16" Margin="0,7" Width="47"  />

Surely there are others out there who have experienced this issue. Please help!

Thanks

  • 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-12T13:18:16+00:00Added an answer on June 12, 2026 at 1:18 pm

    There is not much you can do about the odd automatic behaviors in the XAML designer. As a general word to the wise, you are often better of using XAML text editor instead of the designer to edit your xaml.

    Fortunately in your special case there is a solution. The behavior depends on where you acutally grab the column with the mouse:

    If you grab it at the top it will set new margins.
    grab at the top

    if you grab it below (at the line) it will not set/change margins.
    grab at the bottom

    Update: This feature does not exist in VS 2012 anymore.

    You can now change the behavior of a column resize with the Ctrl and/or the Shift key. But none of the behaviors yield the result that you’re after.

    In case all your items within the grid do not have a Width and a Margin set, your best bet is to resize the columns without any modifier key (in VS2012 it should not destroy the layout visually, it should just add the unecessary Margin, Height and Width properties) and then in the Document Outline window multiselect all the elements and in the Properties view Klick the Set To Auto button. This will delete the unnecessary properties.

    Set To Auto

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

Sidebar

Related Questions

I have encountered a most annoying problem that occurs on the PWD variable when
This is easily one of the most annoying features of Visual Studio in its
well i have most probably an extremly stupid problem but could not figure it
I started working on same project recently and I have noticed some strange problem
I have a very annoying exception which freeze my application thrown by WPF, when
I have a pretty annoying problem here, as Im still trying to internalize each
At my company we have a really annoying problem with our linker (ld 2.17).
I have Visual Studio 2005 (BIDS) set to Check out automatically when a file
This is a question towards programmers who have experience with using Visual Studio 2010
I have a really annoying problem with a deployed Grails application on tomcat 7

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.