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

Hierarchical GridView Rows Expanded

8 Answers 214 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Ristogod
Top achievements
Rank 2
Ristogod asked on 15 Oct 2010, 10:13 PM
I have this GridView that looks like this.

<tg:RadGridView
        tc:RadDockPanel.Dock="Top"
        ItemsSource="{Binding Steps}"
        SelectedItem="{Binding CurrentSelectedStep, Source={x:Static SizingApp:ProjectManager.Instance}, Converter={StaticResource PSSpecConverter}, Mode=TwoWay}"
        Style="{StaticResource RadGridViewStyle}"
        RowLoaded="RadGridView_RowLoaded">
    <tg:RadGridView.ChildTableDefinitions>
        <tg:GridViewTableDefinition>
            <tg:GridViewTableDefinition />
        </tg:GridViewTableDefinition>
    </tg:RadGridView.ChildTableDefinitions>
    <tg:RadGridView.HierarchyChildTemplate>
        <DataTemplate>
            <tg:RadGridView
                    ItemsSource="{Binding Loads}"
                    SelectedItem="{Binding CurrentSelectedLoad, Source={x:Static SizingApp:ProjectManager.Instance}, Converter={StaticResource PSSpecConverter}, Mode=TwoWay}"
                    Style="{StaticResource RadGridViewStyle}">
                <tg:RadGridView.Columns>
                    <tg:GridViewDataColumn DataMemberBinding="{Binding Name}"
                            Header="{Resx ResxName=PSSPECApplication.Controls.ProjectControlResources, Key=StepSummary_LoadColumn_Header}"
                            TextAlignment="Left" />
                    <tg:GridViewDataColumn DataMemberBinding="{Binding Abbreviation}"
                            Header="{Resx ResxName=PSSPECApplication.Controls.ProjectControlResources, Key=StepSummary_TypeColumn_Header}"
                            TextAlignment="Left" />
                    <tg:GridViewDataColumn DataMemberBinding="{Binding Quantity}"
                            Header="{Resx ResxName=PSSPECApplication.Controls.ProjectControlResources, Key=StepSummary_QuantityColumn_Header}"
                            TextAlignment="Center" />
                    <tg:GridViewDataColumn DataMemberBinding="{Binding RunningKVA, StringFormat={}{0:F2}}"
                            Header="{Resx ResxName=PSSPECApplication.Controls.ProjectControlResources, Key=StepSummary_RunningKVAColumn_Header}"
                            TextAlignment="Right" />
                    <tg:GridViewDataColumn DataMemberBinding="{Binding RunningKW, StringFormat={}{0:F2}}"
                            Header="{Resx ResxName=PSSPECApplication.Controls.ProjectControlResources, Key=StepSummary_RunningKWColumn_Header}"
                            TextAlignment="Right" />
                    <tg:GridViewDataColumn DataMemberBinding="{Binding StartingKVA, StringFormat={}{0:F2}}"
                            Header="{Resx ResxName=PSSPECApplication.Controls.ProjectControlResources, Key=StepSummary_StartingKVAColumn_Header}"
                            TextAlignment="Right" />
                    <tg:GridViewDataColumn DataMemberBinding="{Binding StartingKW, StringFormat={}{0:F2}}"
                            Header="{Resx ResxName=PSSPECApplication.Controls.ProjectControlResources, Key=StepSummary_StartingKWColumn_Header}"
                            TextAlignment="Right" />
                    <tg:GridViewCheckBoxColumn DataMemberBinding="{Binding IsNonLinear}"
                            Header="{Resx ResxName=PSSPECApplication.Controls.ProjectControlResources, Key=StepSummary_NonLinearColumn_Header}" />          
                </tg:RadGridView.Columns>
            </tg:RadGridView>
        </DataTemplate>
    </tg:RadGridView.HierarchyChildTemplate>
    <tg:RadGridView.Columns>
        <tg:GridViewDataColumn DataMemberBinding="{Binding Name}"
            Header="{Resx ResxName=PSSPECApplication.Controls.ProjectControlResources, Key=ProjectSummary_StepColumn_Header}"
            TextAlignment="Left" />
        <tg:GridViewDataColumn DataMemberBinding="{Binding VoltageDip, StringFormat={Resx ResxName=PSSPECApplication.Controls.ProjectControlResources, Key=VoltageDipFormat}}"
            Header="{Resx ResxName=PSSPECApplication.Controls.ProjectControlResources, Key=ProjectSummary_VoltageDip_Header}"
            TextAlignment="Center"/>
        <tg:GridViewDataColumn DataMemberBinding="{Binding RunningKVA, StringFormat={}{0:F2}}"
            Header="{Resx ResxName=PSSPECApplication.Controls.ProjectControlResources, Key=ProjectSummary_RunningKVAColumn_Header}"
            TextAlignment="Right"/>
        <tg:GridViewDataColumn DataMemberBinding="{Binding RunningKW, StringFormat={}{0:F2}}"
            Header="{Resx ResxName=PSSPECApplication.Controls.ProjectControlResources, Key=ProjectSummary_RunningKWColumn_Header}"
            TextAlignment="Right"/>
        <tg:GridViewDataColumn DataMemberBinding="{Binding StartingKVA, StringFormat={}{0:F2}}"
            Header="{Resx ResxName=PSSPECApplication.Controls.ProjectControlResources, Key=ProjectSummary_StartingKVAColumn_Header}"
            TextAlignment="Right"/>
        <tg:GridViewDataColumn DataMemberBinding="{Binding StartingKW, StringFormat={}{0:F2}}"
            Header="{Resx ResxName=PSSPECApplication.Controls.ProjectControlResources, Key=ProjectSummary_StartingKWColumn_Header}"
            TextAlignment="Right"/>
        <tg:GridViewDataColumn DataMemberBinding="{Binding RunningKVASum, StringFormat={}{0:F2}}"
            Header="{Resx ResxName=PSSPECApplication.Controls.ProjectControlResources, Key=ProjectSummary_RunningKVASumColumn_Header}"
            TextAlignment="Right"/>
        <tg:GridViewDataColumn DataMemberBinding="{Binding RunningKWSum, StringFormat={}{0:F2}}"
            Header="{Resx ResxName=PSSPECApplication.Controls.ProjectControlResources, Key=ProjectSummary_RunningKWSumColumn_Header}"
            TextAlignment="Right"/>
    </tg:RadGridView.Columns>
</tg:RadGridView>

I've been trying to get this to have the rows be expanded after binding if there are Loads within Steps. However I can't figure out how to make them Expended by Default, and how to hide the IsExpandable click opener when there are no Loads within Steps. In the help file, it shows how to enable and disable IsExpandable on RowLoaded event. However, when binding occurs, nothing is updated as the RowLoaded doesn't fire. Can anyone comment on how to make the rows expanded by default, and which events to use to make the IsExpandable work as binding occurs?

8 Answers, 1 is accepted

Sort by
0
Accepted
Maya
Telerik team
answered on 18 Oct 2010, 07:32 AM
Hello Ristogod,

You may take a look at this blog post for a reference.
 

Kind regards,
Maya
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Ristogod
Top achievements
Rank 2
answered on 18 Oct 2010, 03:33 PM
Thank you. I was able get it working with this information.
0
Lynne
Top achievements
Rank 1
answered on 06 Sep 2011, 05:59 PM
Is this link to the blog post example still valid?  I keep getting a server error and have tried several times over a couple of days.
0
Maya
Telerik team
answered on 07 Sep 2011, 07:13 AM
Hi Lynne,

Please use this link instead. Do you still continue to get that error ?
 

Greetings,
Maya
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

0
Lynne
Top achievements
Rank 1
answered on 07 Sep 2011, 04:44 PM
That link works!  Thank you very much. -LW
0
Lynne
Top achievements
Rank 1
answered on 04 Nov 2011, 05:36 PM
Would you please update the invalid blog post link in your response.  And, since this is the 3rd or 4th time I've asked the exact same question, would you please have something spider through your forums and fix up the blog URLs?

Thanks very much,

-
0
Atanas
Telerik team
answered on 08 Nov 2011, 06:33 PM
Hello Lynne,

We are currently refactoring our blogs due to the many broken links that suddenly appeared after a bug in the URL generator. Very soon we will apply major fix that should fix almost all broken links in our blogs and I hope that after this fix you want experience anymore such issues.

All the best,
Atanas
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Lynne
Top achievements
Rank 1
answered on 08 Nov 2011, 06:40 PM
Thank you very much!
Tags
GridView
Asked by
Ristogod
Top achievements
Rank 2
Answers by
Maya
Telerik team
Ristogod
Top achievements
Rank 2
Lynne
Top achievements
Rank 1
Lynne
Top achievements
Rank 1
Atanas
Telerik team
Share this question
or