This is a migrated thread and some comments may be shown as answers.

Find a control inside HierarchyChildTemplate (RadGridView)

0 Answers 85 Views
GridView
This is a migrated thread and some comments may be shown as answers.
raghul
Top achievements
Rank 1
raghul asked on 21 Nov 2011, 04:29 PM
Hi,

I need to find the controls inside the HierarchyChildTemplate. I have got a listbox inside the HierarchyChildTemplate how should I find the listbox , which event should I need to use to find the listbox control.
Please find my attached coding
<telerik:RadGridView MinHeight="526" MaxHeight="535" telerik:Theming.Theme="Summer" IsReadOnly="True" 
                                AutoGenerateColumns="False" ShowGroupPanel="False" IsFilteringAllowed="True"
                                Name="grdDiscTriage" ItemsSource="{Binding lstDiscTriage}" RowIndicatorVisibility="Collapsed"
                                Loaded="grdDiscTriage_Loaded" RowIsExpandedChanging="grdDiscTriage_RowExpandedChanging">
               <telerik:RadGridView.ChildTableDefinitions>
                   <telerik:GridViewTableDefinition />
               </telerik:RadGridView.ChildTableDefinitions>
               <telerik:RadGridView.Columns>
                   <telerik:GridViewDataColumn Header="{Binding Path=DefectRes.StatHistDateGrid, Source={StaticResource ResourceWrapper}}" DataMemberBinding="{Binding Date}" UniqueName="Date" Width="240"></telerik:GridViewDataColumn>
                   <telerik:GridViewDataColumn Header="{Binding Path=DefectRes.StatHisStatChangGrid, Source={StaticResource ResourceWrapper}}" DataMemberBinding="{Binding Status}" UniqueName="Status" Width="220"></telerik:GridViewDataColumn>
                   <telerik:GridViewDataColumn Header="{Binding Path=DefectRes.StatHisModByGrid, Source={StaticResource ResourceWrapper}}" DataMemberBinding="{Binding Modifiedby}" UniqueName="Modifiedby" Width="*"></telerik:GridViewDataColumn>
                   <telerik:GridViewDataColumn Header="{Binding Path=DefectRes.StatHisReasonGrid, Source={StaticResource ResourceWrapper}}" DataMemberBinding="{Binding Reason}" UniqueName="Reason" Width="*"></telerik:GridViewDataColumn>
               </telerik:RadGridView.Columns>
               <telerik:RadGridView.HierarchyChildTemplate>
                   <DataTemplate>
                       <StackPanel Orientation="Horizontal" x:Name="lstboxStackPanel">
                           <ListBox x:Name="lstBox" Width="1200" Height="200"
                            VerticalAlignment="Top" ItemsSource="{Binding}">
                               <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="950">
                                                   <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="950">
                                                           <TextBlock Name="txtCmtDetails" Text="{Binding Note}" Width="950" TextWrapping="Wrap"></TextBlock>
                                                       </StackPanel>
                                                   </telerik:RadExpander.Content>
                                               </telerik:RadExpander>
                                           </Border>
                                       </StackPanel>
                                   </DataTemplate>
                               </ListBox.ItemTemplate>
                           </ListBox>
                       </StackPanel>
                   </DataTemplate>
               </telerik:RadGridView.HierarchyChildTemplate>
           </telerik:RadGridView>

Now I have to find the listbox in order to bind the objects list to it. How to solve this? Any Help is appriciated.

Regards

Raghul

No answers yet. Maybe you can help?

Tags
GridView
Asked by
raghul
Top achievements
Rank 1
Share this question
or