Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Bind a textblock to the value of a textbox

Posted on 2010-08-15
1
Medium Priority
?
821 Views
Last Modified: 2012-08-14
I have a textblock

<TextBlock Height="43" HorizontalAlignment="Left" Margin="12,12,0,0" Name="textBlock2" Text="TheCompany" VerticalAlignment="Top" Width="818" TextAlignment="Center" FontSize="20" Foreground="#FF767C96" FontWeight="Normal" FontStyle="Normal" FontStretch="Normal" FontFamily="Georgia" />

And I want to have it bound to the value of a textbox

<TextBox Grid.Column="1" Grid.Row="1" Height="23" HorizontalAlignment="Left" Margin="6,2,0,0" Name="textBox1" VerticalAlignment="Top" Width="253" />

How do I do that? Both these controls are in the same grid object.

Thank you
0
Comment
Question by:KiasChaos83
1 Comment
 
LVL 5

Accepted Solution

by:
KiasChaos83 earned 0 total points
ID: 33442727
I figured it out..

Adding the following attribute to the textblock made it work

Text="{Binding ElementName=txtPartnerName, Path=Text}"
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question