Hi,
Binding doesn't seem to work in the HeaderTemplate of the GroupBox control.
I can bind the Header property but not the content in HeaderTemplate. The header is blank.
Here is my XAML:
Here is the code behind:
The header doesn't appear.
If I use the Header property instead of the HeaderTemplate, it works:
Also If I bind to a static resource it works.
Is this an issue or a normal behavior?
Eventually I will have to use the HeaderTemplate property to set a more complex header.
Thanks,
Alex
Binding doesn't seem to work in the HeaderTemplate of the GroupBox control.
I can bind the Header property but not the content in HeaderTemplate. The header is blank.
Here is my XAML:
<
UserControl
x:Class
=
"SilverlightApplication4.MainPage"
xmlns:telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
mc:Ignorable
=
"d"
d:DesignHeight
=
"300"
d:DesignWidth
=
"400"
>
<
Grid
x:Name
=
"LayoutRoot"
Background
=
"White"
>
<
telerik:GroupBox
Margin
=
"10"
>
<
telerik:GroupBox.HeaderTemplate
>
<
DataTemplate
>
<
TextBlock
Text
=
"{Binding sHeader}"
/>
</
DataTemplate
>
</
telerik:GroupBox.HeaderTemplate
>
</
telerik:GroupBox
>
</
Grid
>
</
UserControl
>
Here is the code behind:
using
System.Windows.Controls;
namespace
SilverlightApplication4
{
public
partial
class
MainPage : UserControl
{
public
string
sHeader {
get
;
set
; }
public
MainPage()
{
InitializeComponent();
sHeader =
"My Header"
;
this
.LayoutRoot.DataContext =
this
;
}
}
}
The header doesn't appear.
If I use the Header property instead of the HeaderTemplate, it works:
<
UserControl
x:Class
=
"SilverlightApplication4.MainPage"
xmlns:telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
mc:Ignorable
=
"d"
d:DesignHeight
=
"300"
d:DesignWidth
=
"400"
>
<
Grid
x:Name
=
"LayoutRoot"
Background
=
"White"
>
<
telerik:GroupBox
Margin
=
"10"
Header
=
"{Binding sHeader}"
>
</
telerik:GroupBox
>
</
Grid
>
</
UserControl
>
Also If I bind to a static resource it works.
Is this an issue or a normal behavior?
Eventually I will have to use the HeaderTemplate property to set a more complex header.
Thanks,
Alex