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

Upgraded to WPF Q3 2009 and Hierarchy doesn't work anymore

1 Answer 47 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Brian Thomas
Top achievements
Rank 1
Brian Thomas asked on 16 Dec 2009, 05:58 PM
Due to some errors I was having in Q2, I thought I would upgrade to Q3. Now my Grid's hierarchy doesn't work anymore. I installed the update, removed my references from my project, then added the new ones. The plus signs load but they don't actually expand when clicked.

I looked at the examples and made one change to reflect the example but still no luck.

<Window x:Class="WTSCGCAppInterface.Header" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:TelerikInput="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Input" 
    Title="Header" Height="600" Width="800" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
    <Grid> 
        <telerik:RadWrapPanel Height="60" Name="radPnlFilter" VerticalAlignment="Top"
            <Label Grid.Row="0" Grid.Column="0">Cust#:</Label> 
            <TextBox x:Name="txtCustNum" Width="50" Grid.Row="0" Grid.Column="0"></TextBox> 
            <Label Grid.Row="0" Grid.Column="0">Week Ending#:</Label> 
            <TelerikInput:RadMaskedTextBox x:Name="txtWeekEnding" Mask="##/##/####" Grid.Row="0" Grid.Column="0"></TelerikInput:RadMaskedTextBox> 
            <Label Grid.Row="0" Grid.Column="0">Job#:</Label> 
            <TextBox x:Name="txtJobNum" Width="50" Grid.Row="0" Grid.Column="0"></TextBox> 
            <Label Grid.Row="0" Grid.Column="0">Sub Job#:</Label> 
            <TextBox x:Name="txtSubJobNum" Width="50" Grid.Row="0" Grid.Column="0"></TextBox> 
            <Button x:Name="btnFilter" Click="btnFilter_Click">Apply Filter</Button> 
        </telerik:RadWrapPanel>        
        <telerik:RadGridView Margin="0,58,0,0" Name="radGrdVwHeader" AutoGenerateColumns="False" ColumnsWidthMode="Fill" RowLoaded="radGrdVwHeader_RowLoaded"
            <telerik:RadGridView.Columns>    
                <telerik:GridViewDataColumn Header="HSTAT" UniqueName="HSTAT" IsVisible="False" /> 
                <telerik:GridViewDataColumn Header="HCONO" UniqueName="HCONO" IsVisible="False" /> 
                <telerik:GridViewDataColumn Header="HDVNO" UniqueName="HDVNO" IsVisible="False" /> 
                <telerik:GridViewDataColumn Header="HSEQ" UniqueName="HSEQ" IsVisible="False" /> 
                <telerik:GridViewDataColumn Header="HCUST" UniqueName="HCUST" IsVisible="False" /> 
                <telerik:GridViewDataColumn Header="Job #" UniqueName="HJBNO" /> 
                <telerik:GridViewDataColumn Header="Sub Job #" UniqueName="HSJNO" /> 
                <telerik:GridViewDataColumn Header="Week Ending" UniqueName="HDTTK" /> 
                <telerik:GridViewDataColumn Header="HDSCD" UniqueName="HDSCD" IsVisible="False" /> 
                <telerik:GridViewDataColumn Header="Ticket#" UniqueName="HNUM0" /> 
                <telerik:GridViewDataColumn Header="Crew#" UniqueName="HDES0" /> 
                <telerik:GridViewDataColumn Header="District" UniqueName="HDES1" /> 
                <telerik:GridViewDataColumn Header="FMC#" UniqueName="HDES2" /> 
                <telerik:GridViewDataColumn Header="Division" UniqueName="HDES3" /> 
                <telerik:GridViewDataColumn Header="Local#" UniqueName="HDES4" /> 
                <telerik:GridViewDataColumn Header="Crew Type" UniqueName="HDES5" /> 
                <telerik:GridViewDataColumn Header="Zone" UniqueName="HDES6" />                                                                                                               
            </telerik:RadGridView.Columns> 
            <telerik:RadGridView.ChildTableDefinitions> 
                <telerik:GridViewTableDefinition/> 
            </telerik:RadGridView.ChildTableDefinitions> 
            <telerik:RadGridView.HierarchyChildTemplate> 
                <DataTemplate> 
                    <telerik:RadGridView x:Name="ProdData" AutoGenerateColumns="False"
                        <telerik:RadGridView.Columns> 
                            <telerik:GridViewDataColumn Header="PCWNO" UniqueName="PCWNO" /> 
                        </telerik:RadGridView.Columns> 
                    </telerik:RadGridView> 
                </DataTemplate> 
            </telerik:RadGridView.HierarchyChildTemplate> 
        </telerik:RadGridView>                
    </Grid> 
</Window> 
 

private void btnFilter_Click(object sender, RoutedEventArgs e) 
        { 
            string sWeekEnding = txtWeekEnding.MaskedText; 
            string sAlteredFormat = sWeekEnding.Substring(6, 4) + sWeekEnding.Substring(0, 2) + sWeekEnding.Substring(3, 2); 
             
            radGrdVwHeader.ItemsSource = _headerRecs.GetHeaderRecs(1, 0, Convert.ToDecimal(txtCustNum.Text), Convert.ToDecimal(sAlteredFormat), txtJobNum.Text, txtSubJobNum.Text, nullnull"");             
 
            radGrdVwHeader.ChildTableDefinitions.Clear(); 
            GridViewTableDefinition proddataDefinition = new GridViewTableDefinition(); 
            proddataDefinition.Relation = new PropertyRelation("ProddataRecs"); 
            //this.radGrdVwHeader.TableDefinition.ChildTableDefinitions.Add(proddataDefinition); 
            this.radGrdVwHeader.ChildTableDefinitions.Add(proddataDefinition); 
                      
        } 






1 Answer, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 18 Dec 2009, 08:17 AM
Hi Brian,

Here is an example how to fix this:

...
<telerik:RadGridView.HierarchyChildTemplate>
                <DataTemplate>
                    <telerik:RadGridView x:Name="ProdData" ItemsSource="{Binding ProddataRecs}" AutoGenerateColumns="False">
                        <telerik:RadGridView.Columns>
                            <telerik:GridViewDataColumn Header="PCWNO" UniqueName="PCWNO" />
                        </telerik:RadGridView.Columns>
                    </telerik:RadGridView>
                </DataTemplate>
            </telerik:RadGridView.HierarchyChildTemplate>
...


Best wishes,
Vlad
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
GridView
Asked by
Brian Thomas
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Share this question
or