I have a tabcontrol which I want to bind to a object list. The header of the tab as well as the content, a gridview, should be bound to the list of objects. However there are some problems with the binding. The header does not show and the content (grodview) only apears after selecting the tabs. Without selecting the ObjectName is shown on the first tab.
C# Code:
Does anybody know whats going on? Thank you very much for any hint.
Volkmar
C# Code:
public
class
InfoWindowContent : INotifyPropertyChanged
{
public
IDictionary<
string
,
string
> ContentList {
get
;
set
; }
public
string
HeaderStr;
public
event
PropertyChangedEventHandler PropertyChanged;
public
void
RaisePropertyChanged(
string
property)
{
if
(PropertyChanged !=
null
)
{
PropertyChanged(
this
,
new
PropertyChangedEventArgs(property));
}
}
}
public
class
ApDataContext : INotifyPropertyChanged
{
private
ObservableCollection<InfoWindowContent> _infoContainer =
new
ObservableCollection<InfoWindowContent>();
public
event
PropertyChangedEventHandler PropertyChanged;
public
User Login {
get
;
private
set
; }
public
Farm Farm {
get
;
private
set
; }
public
MapServiceMapServerAttributes Msa {
get
;
set
; }
public
ObservableCollection<InfoWindowContent> InfoContainer
{
get
{
return
_infoContainer;
}
set
{
_infoContainer = value;
RaisePropertyChanged(
"InfoContainer"
);
}
}
}
<
telerik:RadPaneGroup
x:Name
=
"RadPaneGroup_Info"
telerik:RadDocking.SerializationTag
=
"RadPaneGroup_Info"
>
<
telerik:RadPane
x:Name
=
"InfoPane"
Header
=
"Information"
>
<
telerik:RadTabControl
x:Name
=
"tabControlInfo"
ItemsSource
=
"InfoContainer"
Align
=
"Left"
SelectedIndex
=
"0"
>
<
telerik:RadTabControl.ItemContainerStyle
>
<!--The style that will be applied to all the items-->
<
Style
TargetType
=
"telerik:RadTabItem"
>
<!--Setting the template for the headers.-->
<
Setter
Property
=
"HeaderTemplate"
>
<
Setter.Value
>
<
DataTemplate
>
<
TextBlock
Text
=
"{Binding HeaderStr}"
FontSize
=
"11"
Margin
=
"5 0 5 0"
VerticalAlignment
=
"Center"
/>
</
DataTemplate
>
</
Setter.Value
>
</
Setter
>
<
Setter
Property
=
"ContentTemplate"
>
<
Setter.Value
>
<
DataTemplate
>
<
Grid
HorizontalAlignment
=
"Left"
VerticalAlignment
=
"Top"
Margin
=
"5"
>
<
telerikGridView:RadGridView
x:Name
=
"RadGridViewInfo"
IsReadOnly
=
"False"
ItemsSource
=
"{Binding ContentList}"
AutoGenerateColumns
=
"True"
ColumnWidth
=
"Auto"
SelectionChanged
=
"RadGridViewInfo_SelectionChanged"
ShowGroupPanel
=
"False"
ShowColumnHeaders
=
"False"
Background
=
"White"
VerticalGridLinesBrush
=
"#46CBCBCB"
>
</
telerikGridView:RadGridView
>
</
Grid
>
</
DataTemplate
>
</
Setter.Value
>
</
Setter
>
</
Style
>
</
telerik:RadTabControl.ItemContainerStyle
>
</
telerik:RadTabControl
>
</
telerik:RadPane
>
</
telerik:RadPaneGroup
>
Does anybody know whats going on? Thank you very much for any hint.
Volkmar