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

Drill down grid

16 Answers 118 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Kristjan Einarsson
Top achievements
Rank 1
Kristjan Einarsson asked on 23 Mar 2010, 09:40 PM
Hi, I need to make a drill down gridview (witch can have X many levels) with aggregations on  each level.

Is there an easy way to do this in codebehind with WPF RadGridView ?

Regards
Kristján.

16 Answers, 1 is accepted

Sort by
0
Pavel Pavlov
Telerik team
answered on 24 Mar 2010, 09:14 AM
Hi Kristjan Einarsson,
Please give me more details about your data structure and I will try to prepare a close-to-real  example for you .

Greetings,
Pavel Pavlov
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
Kristjan Einarsson
Top achievements
Rank 1
answered on 24 Mar 2010, 12:00 PM
Hi, 
I hope this will clear things up :)

The attached image describes the structure.

You would drill with the dimension.
For this structure There are the groups Drinks, coke and pepsi.

The minus indicates the group is open, the plus indicates that you can drill deeper.

The columns layout would have to hold, and when drilling a new column header will not appear.

Regards
Kristján.
0
Pavel Pavlov
Telerik team
answered on 24 Mar 2010, 03:08 PM
Hi Kristjan Einarsson,

Thanks ! As they say a picture is worth a thousand words.

Unfortunately RadGridView does not support such TreeListView mode internally.
We are in the process of preparing a separate control to do that  but we are still at very early stage.

With some hacks we can exploit the RowDetails feature of RadGridView to achieve a  some-kind close behavior.

I am sending you a small sample project so you can decide yourself whether this is a suitable approach.

There we have some nested grids ( in row details and with columns aligned), and the first column has a templated cell to mimic the tree-like appearance.

Regards,
Pavel Pavlov
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
Kristjan Einarsson
Top achievements
Rank 1
answered on 24 Mar 2010, 05:42 PM
Hi thanks for the code,
I get an error when I try to open the project up in Visual Studio 2008 (sp1). Version 9.0.30729.1SP

I get the error:
"The Project type is not supported by this installation"

If you have a quick solution I would be glad other vise I´ll just try to implement the code and see if it works :)

Again thank you

Regards
Kristján.

0
Pavel Pavlov
Telerik team
answered on 24 Mar 2010, 06:12 PM
Hi Kristjan Einarsson,

It is kind of strange . That is the exact version I have used when I created the project . I have retested the archive and there were no problems opening the project with the following version of VS:

Microsoft Visual Studio 2008
Version 9.0.30729.1 SP
Microsoft .NET Framework
Version 3.5 SP1


Regards,
Pavel Pavlov
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
Kristjan Einarsson
Top achievements
Rank 1
answered on 24 Mar 2010, 06:48 PM
Weird,
It is a WPF project not silverlight ?,

Thanks for you help
Kristján.
0
Pavel Pavlov
Telerik team
answered on 25 Mar 2010, 09:33 AM
Hello Kristjan Einarsson,

Actually it is a Silverlight project , please excuse me for the missunderstanding . However you may use the same approach in WPF as RadGridView for WPF shares the same API and codebase.

Let me know in case you need it for WPF .  I will gladly prepare it for you .

Best wishes,
Pavel Pavlov
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
Kristjan Einarsson
Top achievements
Rank 1
answered on 07 Apr 2010, 11:17 AM
Hi again,
sorry for the late reply,
If you could prepare it for me it would be much appreciated.

Thanks again.
Kristjan.
0
Pavel Pavlov
Telerik team
answered on 12 Apr 2010, 09:53 AM
Hi Kristjan Einarsson,
I have ported the project to WPF for you . Please find it attached.
I have included the compiled binaries as well so you can give it a try in case you still have troubles with the proj file.

Kind regards,
Pavel Pavlov
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
Kristjan Einarsson
Top achievements
Rank 1
answered on 12 Apr 2010, 03:00 PM
Hi again and thank you for the example.
We are going to start using this method for now :)

"Unfortunately RadGridView does not support such TreeListView mode internally.
We are in the process of preparing a separate control to do that  but we are still at very early stage."

Do you know if this will be in the next release ?

Regards
kristján.
0
Pavel Pavlov
Telerik team
answered on 12 Apr 2010, 03:03 PM
Hello Kristjan Einarsson,

We are doing our best to make it for the Q2 release.

Sincerely yours,
Pavel Pavlov
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
Kristjan Einarsson
Top achievements
Rank 1
answered on 30 Apr 2010, 11:17 AM
Hi again,
Well until your release We are going to use this solution.
But I have one question about Datatemplate...

<Grid.Resources> 
<DataTemplate x:Key="RowDetailsTemplateLevel3" > 
    <telerik:RadGridView x:Name="subgrid" Loaded="subgrid_Loaded" 
         Margin="-2,-1,-1,-2" 
         FrozenColumnCount="1" 
         CanUserFreezeColumns="False" 
         ShowGroupPanel="False" 
         RowIndicatorVisibility="Collapsed" 
         ShowColumnHeaders="False" 
         AutoGenerateColumns="False" CellEditEnded="RadGridView1_CellEditEnded"
    <telerik:RadGridView.Columns> 
    <telerik:GridViewDataColumn CellStyle="{StaticResource toggleCellStyle}"  IsFilterable="False" 
    DataMemberBinding="{Binding ProductName}" Width="200" Header="Tree" IsReadOnly="True"  /> 
    <telerik:GridViewDataColumn IsFilterable="False" DataMemberBinding="{Binding ProductID}" Width="200" Header="ProductID" /> 
                   . 
                   . 
                   . 
</DataTemplate> 
</telerik:RadGridView> 
</Grid.Resources> 

Would I be able to create the Datatemplate for the levels in code behind ?

Best regards
Kristján.
0
Pavel Pavlov
Telerik team
answered on 03 May 2010, 10:43 AM
Hello Kristjan Einarsson,
I am not sure I get the question right - do yo need a different DataTemplate for the different levels or you need one common template for all levels , but created in code-behind  rather than in XAML ?

Kind regards,
Pavel Pavlov
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
Kristjan Einarsson
Top achievements
Rank 1
answered on 03 May 2010, 11:15 AM
Hi sorry if I wasn't clear  :)

I need to create the template for each level in code behind.
0
Pavel Pavlov
Telerik team
answered on 03 May 2010, 01:21 PM
Hello Kristjan Einarsson,

The attached modified sample loads the template in code behind .
 Please note that it still reads the template from the resources. I could not find a way to "create "  the template in code behind ( e.g. using the FrameworkElementFactory) as this approach could not allow to handle the loaded event of child grids properly.

Regards,
Pavel Pavlov
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
Kristjan Einarsson
Top achievements
Rank 1
answered on 04 May 2010, 09:30 AM
Thank you :)
Tags
GridView
Asked by
Kristjan Einarsson
Top achievements
Rank 1
Answers by
Pavel Pavlov
Telerik team
Kristjan Einarsson
Top achievements
Rank 1
Share this question
or