Quantcast
Channel: Silverlight 5 forum
Viewing all articles
Browse latest Browse all 1083

Make xaml grid column expand to fullest extent

$
0
0

Im using a grid in a data template and want one of the columns to expand as wide. This data template is used in a data grid row and I need the columns to the right to always be in alignment. the screenshot below will demonstrate what I don't want.

And here's the xaml for the grid

<DataTemplate><Grid   HorizontalAlignment="Stretch" Height="50" Background="Transparent" Width="Auto"><Grid.RowDefinitions><RowDefinition  /><RowDefinition/></Grid.RowDefinitions><Grid.ColumnDefinitions><ColumnDefinition Width="40" /><!-- THIS COLUMN NEEDS TO EXPAND ALL THE WAY TO THE RIGHT, BUT IT DOESN'T--><ColumnDefinition  Width="Auto" /><ColumnDefinition Width="30" /></Grid.ColumnDefinitions><Image Grid.RowSpan="2" Source="{ Binding Path=., Converter={StaticResource imgConverter}}" Stretch="None"  /><TextBlock Grid.Column="1" Text="{Binding FS_FileName}"  TextWrapping="Wrap"   VerticalAlignment="Bottom" FontSize="12" Foreground="#FF444444" FontWeight="Bold"       /><TextBlock Grid.Column="1" Grid.Row="1" Text="{Binding UserStampAndFileSize}"  TextWrapping="Wrap" VerticalAlignment="Top"  Foreground="#FF444444"       /><!--THIS IS THE BUTTON THAT NEEDS TO BE ALINGED ON THE VERY RIGHT SIDE OF THE CONTROL--><Button x:Name="btnOpenFile" Grid.Column="2" Grid.RowSpan="2" HorizontalAlignment="Center" VerticalAlignment="Center"  Content="O" Click="btnOpenFile_Click"  ToolTipService.ToolTip="Open this attachment"  /></Grid></DataTemplate>

Thank you for any help you can offer.


Viewing all articles
Browse latest Browse all 1083

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>