?
Solved

Move button by TextBlock length

Posted on 2011-10-25
1
Medium Priority
?
376 Views
Last Modified: 2012-06-21
Hello all,

I program with WPF. How can I move my button according to the length of TextBlock? The button should always at the end of the Textblock. (Attached file, button doesn't move together with the TextBlock)  

myFile.xaml

<UserControl>
     <Grid>
          <DataGrid>
               <DataGrid.Columns>
                     <DataGridTextColumn ....  />
                     <DataGridTextColumn ....  />
                      <DataGridTemplateColumn>
                      <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <StackPanel Orientation="Horizontal">
                                <TextBlock HorizontalAlignment="Left"/>
                                <Button HorizontalAlignment="Right" VerticalAlignment="Bottom"/>
                            </StackPanel>
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>
               </DataGrid.Columns>
          </DataGrid>
     </Grid>
</UserControl>

Thank you very much in advance. :)
2011-10-25-124014.jpg
0
Comment
Question by:chang2008
1 Comment
 
LVL 10

Accepted Solution

by:
ukerandi earned 2000 total points
ID: 37023780
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
How can you see what you are working on when you want to see it while you to save a copy? Add a "Save As" icon to the Quick Access Toolbar, or QAT. That way, when you save a copy of a query, form, report, or other object you are modifying, you…
Planning to migrate your EDB file(s) to a new or an existing Outlook PST file? This video will guide you how to convert EDB file(s) to PST. Besides this, it also describes, how one can easily search any item(s) from multiple folders or mailboxes…
Suggested Courses
Course of the Month8 days, 16 hours left to enroll

621 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