I recently upgraded to the Q3 2010 RadControls for Silverlight and it seems as though the RadExpander control has changed. My old code (which worked perfectly) looked like this:
The new code (that is not working) looks like this:
The lines that contain my control (3, 4, 5) show the error: "Object reference not set to an instance of an object." If I move "MyControl" outside of the RadExpander it works fine.
What am I doing wrong, or am I no longer able to use the RadExpander control as I was before?
<
telerik:RadExpander
Visibility
=
"Collapsed"
x:Name
=
"radExpander"
Foreground
=
"White"
BorderThickness
=
"0"
ExpandDirection
=
"Down"
Header
=
""
IsExpanded
=
"True"
HorizontalAlignment
=
"Center"
VerticalAlignment
=
"Bottom"
Width
=
"450"
Margin
=
"0,0,0,25"
>
<!-- Margin="0,0,15,10"-->
<
local:MyControl
x:Name
=
"MyControl"
Background
=
"#FF2B2B2B"
BorderThickness
=
"1"
BorderBrush
=
"#FF000000"
Height
=
"30"
Margin
=
"0,0,0,0"
>
<
TextBlock
FontSize
=
"13"
Height
=
"25"
Foreground
=
"White"
Text
=
""
TextWrapping
=
"Wrap"
Padding
=
"0"
/>
</
local:MyControl
>
</
telerik:RadExpander
>
The new code (that is not working) looks like this:
<
telerik:RadExpander
Visibility
=
"Visible"
x:Name
=
"radExpander"
Foreground
=
"White"
BorderThickness
=
"0"
ExpandDirection
=
"Down"
Header
=
""
IsExpanded
=
"True"
HorizontalAlignment
=
"Center"
VerticalAlignment
=
"Bottom"
Width
=
"450"
Margin
=
"0,0,0,25"
>
<
telerik:RadExpander.Content
>
<
local:MyControl
x:Name
=
"MyControl"
Margin
=
"0,0,0,0"
Background
=
"#FF2B2B2B"
BorderThickness
=
"1"
BorderBrush
=
"#FF000000"
Height
=
"30"
>
<
TextBlock
FontSize
=
"13"
Height
=
"25"
Foreground
=
"White"
Text
=
""
TextWrapping
=
"Wrap"
Padding
=
"0"
/>
</
local:MyControl
>
</
telerik:RadExpander.Content
>
</
telerik:RadExpander
>
The lines that contain my control (3, 4, 5) show the error: "Object reference not set to an instance of an object." If I move "MyControl" outside of the RadExpander it works fine.
What am I doing wrong, or am I no longer able to use the RadExpander control as I was before?