Hi,
How to find the stackPanel inside HierarchyChildTemplate. Please find the attached coding, when I try to find the value it returns null value, where am I going wrong??
In the code behind I have the coding as
I used the above code in RowExpandedChanging event and also in RowLoaded event every where it returns null value. Please let me know how to find the stackpanel.
Regards,
Raghul
How to find the stackPanel inside HierarchyChildTemplate. Please find the attached coding, when I try to find the value it returns null value, where am I going wrong??
<
telerik:RadGridView.HierarchyChildTemplate
>
<
DataTemplate
>
<
StackPanel
Orientation
=
"Vertical"
x:Name
=
"lstboxStackPanel"
>
<
ListBox
x:Name
=
"lstBox"
Width
=
"800"
Height
=
"150"
VerticalAlignment
=
"Top"
ItemsSource
=
"{Binding ReopenNotes}"
>
<
ListBox.ItemTemplate
>
<
DataTemplate
>
<!--<StackPanel Orientation="Horizontal" x:Name="lstboxStackPanel">-->
<
Border
BorderBrush
=
"Gray"
BorderThickness
=
"0 0 0 1"
Width
=
"Auto"
>
<
telerik:RadExpander
x:Name
=
"radExpander"
IsExpanded
=
"True"
VerticalContentAlignment
=
"Top"
Width
=
"900"
>
<
telerik:RadExpander.Header
>
<
StackPanel
x:Name
=
"TestRadExpanderHeader"
Orientation
=
"Horizontal"
>
<
HyperlinkButton
Name
=
"hlkUserName"
Content
=
"{Binding Author}"
></
HyperlinkButton
>
<
TextBlock
Name
=
"txtCmtInfo"
Text
=
"{Binding Date}"
></
TextBlock
>
</
StackPanel
>
</
telerik:RadExpander.Header
>
<
telerik:RadExpander.Content
>
<
StackPanel
x:Name
=
"SplInsideExpander"
Orientation
=
"Horizontal"
Width
=
"900"
>
<
TextBlock
Name
=
"txtCmtDetails"
Text
=
"{Binding Note}"
Width
=
"890"
TextWrapping
=
"Wrap"
></
TextBlock
>
</
StackPanel
>
</
telerik:RadExpander.Content
>
</
telerik:RadExpander
>
</
Border
>
<!--</StackPanel>-->
</
DataTemplate
>
</
ListBox.ItemTemplate
>
</
ListBox
>
<
TextBox
x:Name
=
"txtCommentsAdd"
Width
=
"800"
Height
=
"75"
></
TextBox
>
<
StackPanel
x:Name
=
"TestActionFooter"
Orientation
=
"Horizontal"
>
<
Button
x:Name
=
"btnAdd"
Content
=
"Add"
Width
=
"Auto"
></
Button
>
<
Button
x:Name
=
"btnClear"
Content
=
"Clear"
Width
=
"Auto"
></
Button
>
</
StackPanel
>
</
StackPanel
>
</
DataTemplate
>
</
telerik:RadGridView.HierarchyChildTemplate
>
In the code behind I have the coding as
StackPanel objTile1 = e.Row.Cells[0].ChildrenOfType<
StackPanel
>().Where(x => x.Name == "lstboxStackPanel").FirstOrDefault();
I used the above code in RowExpandedChanging event and also in RowLoaded event every where it returns null value. Please let me know how to find the stackpanel.
Regards,
Raghul