Hello,
How can I show a specific text string when a RadListBox instance is empty?
I tried defining a style to accomplish this goal, like this:
I then attach it to the RadListBox instance:
This actually works, for the most part... but it has a fatal flaw - the RadListBox scrollbars are no longer correctly themed.
Is there another way of accomplishing this goal? Or could I get some help in tweaking the style above so that the vertical scrollbar has the correct "Windows7" theme applied to it?
How can I show a specific text string when a RadListBox instance is empty?
I tried defining a style to accomplish this goal, like this:
<
Style
TargetType
=
"telerik:RadListBox"
x:Key
=
"ListStyle"
BasedOn
=
"{StaticResource {x:Type telerik:RadListBox}}"
>
<
Style.Triggers
>
<
DataTrigger
Binding
=
"{Binding RelativeSource={x:Static RelativeSource.Self}, Path=Items.Count}"
Value
=
"0"
>
<
Setter
Property
=
"HorizontalAlignment"
Value
=
"Center"
/>
<
Setter
Property
=
"VerticalAlignment"
Value
=
"Top"
/>
<
Setter
Property
=
"Margin"
Value
=
"0, 20, 0, 0"
/>
<
Setter
Property
=
"Template"
>
<
Setter.Value
>
<
ControlTemplate
>
<
TextBlock
Foreground
=
"DimGray"
TextWrapping
=
"Wrap"
FontSize
=
"14"
>
There are currently no items to show.
</
TextBlock
>
</
ControlTemplate
>
</
Setter.Value
>
</
Setter
>
</
DataTrigger
>
</
Style.Triggers
>
</
Style
>
I then attach it to the RadListBox instance:
<
telerik:RadListBox
Style
=
"{StaticResource ListStyle}"
>
// items here
</
telerik:RadListBox
>
This actually works, for the most part... but it has a fatal flaw - the RadListBox scrollbars are no longer correctly themed.
Is there another way of accomplishing this goal? Or could I get some help in tweaking the style above so that the vertical scrollbar has the correct "Windows7" theme applied to it?