Hello,
I think I've found a bug with applying a Telerik style to a ListBox - with the style applied, ListBox items appear as though the ListBox had HorizontalContentAlignment="Left", even when I specify HorizontalContentAlignment="Stretch" .
I've made a little test project to demonstrate, and attached a screen shot of what the app looks like. The only bit omitted is the code-behind - in the window's constructor I add a single empty string to each listbox's items.
You can see that the border on the un-styled listbox extends all the way across the list box, but the border for the telerik styled version is left aligned. Does anyone know why this might be occuring/if there is a workaround I could use?
Regards,
James.
I think I've found a bug with applying a Telerik style to a ListBox - with the style applied, ListBox items appear as though the ListBox had HorizontalContentAlignment="Left", even when I specify HorizontalContentAlignment="Stretch" .
I've made a little test project to demonstrate, and attached a screen shot of what the app looks like. The only bit omitted is the code-behind - in the window's constructor I add a single empty string to each listbox's items.
You can see that the border on the un-styled listbox extends all the way across the list box, but the border for the telerik styled version is left aligned. Does anyone know why this might be occuring/if there is a workaround I could use?
<
Window
x:Class
=
"RadControlsWpfApp1.MainWindow"
xmlns:telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
Title
=
"MainWindow"
Height
=
"350"
Width
=
"525"
>
<
Window.Resources
>
<
Style
TargetType
=
"ListBox"
x:Key
=
"TelerikListBoxStyle"
BasedOn
=
"{StaticResource {telerik:ThemeResourceKey ThemeType=telerik:Office_BlueTheme, ElementType=ListBox}}"
/>
</
Window.Resources
>
<
StackPanel
Orientation
=
"Vertical"
>
<
ListBox
Style
=
"{StaticResource TelerikListBoxStyle}"
x:Name
=
"telerikStyledListBox"
HorizontalContentAlignment
=
"Stretch"
>
<
ListBox.ItemTemplate
>
<
DataTemplate
>
<
Label
Content
=
"telerik style"
BorderThickness
=
"1"
BorderBrush
=
"Black"
/>
</
DataTemplate
>
</
ListBox.ItemTemplate
>
</
ListBox
>
<
ListBox
x:Name
=
"listBox"
HorizontalContentAlignment
=
"Stretch"
>
<
ListBox.ItemTemplate
>
<
DataTemplate
>
<
Label
Content
=
"standard style"
BorderThickness
=
"1"
BorderBrush
=
"Black"
/>
</
DataTemplate
>
</
ListBox.ItemTemplate
>
</
ListBox
>
</
StackPanel
>
</
Window
>
Regards,
James.