This question is locked. New answers and comments are not allowed.
Hi,
I have created a SelectionBoxTemplate using a grid with 3 columns. The first column should auto-size based on the content, the second column is fixed width, and the third column is using * sizing. The problem that I run into is that the first textblock's width is not stretched to fill the available area. The same behavior occurs when applying the below layout to an itemtemplate of a Listbox. The solution is to create a style targeting ListBoxItem and setting its HorizontalContentAlignment to Stretch. I have tried the same idea targeting RadComboBoxItem without any luck. I am using Silverlight 4 binaries.
Thank you in advance
I have created a SelectionBoxTemplate using a grid with 3 columns. The first column should auto-size based on the content, the second column is fixed width, and the third column is using * sizing. The problem that I run into is that the first textblock's width is not stretched to fill the available area. The same behavior occurs when applying the below layout to an itemtemplate of a Listbox. The solution is to create a style targeting ListBoxItem and setting its HorizontalContentAlignment to Stretch. I have tried the same idea targeting RadComboBoxItem without any luck. I am using Silverlight 4 binaries.
Thank you in advance
<
Grid
>
<
Grid.ColumnDefinitions
>
<
ColumnDefinition
Width
=
"Auto"
></
ColumnDefinition
>
<
ColumnDefinition
Width
=
"20"
></
ColumnDefinition
>
<
ColumnDefinition
Width
=
"*"
></
ColumnDefinition
>
</
Grid.ColumnDefinitions
>
<
TextBlock
Text
=
"{Binding Value, Mode=OneWay}"
Foreground
=
"Black"
FontWeight
=
"Bold"
FontFamily
=
"{StaticResource ContentFontFamily}"
FontSize
=
"{StaticResource ContentFontSize}"
TextAlignment
=
"Right"
/>
<
TextBlock
Text
=
"{Binding Meaning, Mode=OneWay}"
Grid.Column
=
"2"
Margin
=
"0,0,0,0"
Foreground
=
"Gray"
FontWeight
=
"Bold"
FontFamily
=
"{StaticResource ContentFontFamily}"
FontSize
=
"{StaticResource ContentFontSize}"
HorizontalAlignment
=
"Left"
TextAlignment
=
"Left"
/>
</
Grid
>