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

Hierarchical Column Group Merger

6 Answers 203 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Roby
Top achievements
Rank 1
Roby asked on 20 Jan 2012, 05:54 PM
In the winforms ColumnGroupsViewDefinition creates a Hierarchical Column Group Merger as in the URL http://www.telerik.com/help/winforms/gridview-viewdefinitions-column-groups-view.html.  Is there anyway to do it in SilverLight that can reproduce the same effect? 

6 Answers, 1 is accepted

Sort by
0
Pavel Pavlov
Telerik team
answered on 20 Jan 2012, 06:02 PM
Hi Roby,

Are you looking for something like this one  ?

Regards,
Pavel Pavlov
the Telerik team

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

0
Roby
Top achievements
Rank 1
answered on 20 Jan 2012, 06:19 PM
Hi Pavel,

Thank you for the very quick response,

Yes I am able to acheive what you have shared but I need one more level of column grouping on top of Vehicle, Engine, Price and that is what I could not achieve. That is, I should be able to group Vehicle and Engine under one common group header and Price and other columns under one header.

I have used the following code achieve one level of column header grouping and it is working fine. Please find the attached screen shot. Now, I would like to make one level of column grouping header but that is not happening - Personal and Others under one & Business and Dates under one.

 

 

 

<telerik:RadGridView Name="radGridView1" MinHeight="100" Visibility="Visible" IsReadOnly="False" AutoGenerateColumns="False"

 

 

 

CanUserFreezeColumns="True" CanUserReorderColumns="True" RowIndicatorVisibility="Collapsed"

 

 

 

ItemsSource="{Binding Data, ElementName=employeeDataSource}">

 

 

 

 

<telerik:RadGridView.RowStyleSelector>

 

 

 

 

<telerik:ConditionalStyleSelector>

 

 

 

 

<telerik:StyleRule Condition="EmployeeID &lt; 11">

 

 

 

 

<telerik:StyleRule.Style>

 

 

 

 

<Style TargetType="telerik:GridViewRow">

 

 

 

 

<Setter Property="IsEnabled" Value="False" />

 

 

 

 

</Style>

 

 

 

 

</telerik:StyleRule.Style>

 

 

 

 

</telerik:StyleRule>

 

 

 

 

</telerik:ConditionalStyleSelector>

 

 

 

 

</telerik:RadGridView.RowStyleSelector>

 

 

 

 

<telerik:RadGridView.ColumnGroups>

 

 

 

 

 

<telerik:GridViewColumnGroup Name="Personal" Header="Personal" />

 

 

 

 

<telerik:GridViewColumnGroup Name="Others" Header="Others" />

 

 

 

 

<telerik:GridViewColumnGroup Name="Business" Header="Business" />

 

 

 

 

<telerik:GridViewColumnGroup Name="Dates" Header="Dates" />

 

 

 

 

 

</telerik:RadGridView.ColumnGroups>

 

 

 

 

<telerik:RadGridView.Columns>

 

 

 

 

<telerik:GridViewDataColumn DataMemberBinding="{Binding EmployeeID}" ColumnGroupName="Personal" />

 

 

 

 

<!--<telerik:GridViewDataColumn DataMemberBinding="{Binding NationalIDNumber}" ColumnGroupName="Personal" />-->

 

 

 

 

<!--<telerik:GridViewDataColumn DataMemberBinding="{Binding ContactID}" ColumnGroupName="Personal" />-->

 

 

 

 

<telerik:GridViewDataColumn DataMemberBinding="{Binding LoginID}" ColumnGroupName="Personal" />

 

 

 

 

<telerik:GridViewDataColumn DataMemberBinding="{Binding MaritalStatus}" ColumnGroupName="Personal" />

 

 

 

 

<telerik:GridViewDataColumn DataMemberBinding="{Binding Gender}" ColumnGroupName="Personal" />

 

 

 

 

<telerik:GridViewDataColumn DataMemberBinding="{Binding BirthDate}" ColumnGroupName="Others" />

 

 

 

 

<!--<telerik:GridViewDataColumn DataMemberBinding="{Binding SalariedFlag}" ColumnGroupName="Business" />-->

 

 

 

 

<telerik:GridViewDataColumn DataMemberBinding="{Binding VacationHours}" ColumnGroupName="Business" />

 

 

 

 

<telerik:GridViewDataColumn DataMemberBinding="{Binding SickLeaveHours}" ColumnGroupName="Business" />

 

 

 

 

<!--<telerik:GridViewDataColumn DataMemberBinding="{Binding CurrentFlag}" ColumnGroupName="Business" />-->

 

 

 

 

<!--<telerik:GridViewDataColumn DataMemberBinding="{Binding rowguid}" ColumnGroupName="Business" />-->

 

 

 

 

<telerik:GridViewDataColumn DataMemberBinding="{Binding ManagerID}" ColumnGroupName="Business" />

 

 

 

 

<telerik:GridViewDataColumn DataMemberBinding="{Binding Title}" ColumnGroupName="Business" />

 

 

 

 

<telerik:GridViewDataColumn DataMemberBinding="{Binding HireDate}" ColumnGroupName="Dates" />

 

 

 

 

<telerik:GridViewDataColumn DataMemberBinding="{Binding ModifiedDate}" ColumnGroupName="Dates" />

 

 

 

 

<telerik:GridViewDataColumn DataMemberBinding="{Binding BirthDate}" ColumnGroupName="Dates" />

 

 

 

 

</telerik:RadGridView.Columns>

 

 

 

 

</telerik:RadGridView>

I hope something would be there to acheiving my requirement. Pleaes help me out. Thank you.

 

0
Pavel Pavlov
Telerik team
answered on 25 Jan 2012, 05:44 PM
Hello Roby ,

I am attaching a small runnable project demonstrating how can you nest headers on 3 levels.

*Please be sure to download the binaries  from our latest internal build as it contains some relevant fixes.

Kind regards,
Pavel Pavlov
the Telerik team

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

0
Roby
Top achievements
Rank 1
answered on 31 Jan 2012, 06:52 AM
Hi Pavel,

Thank you for working on this. Here you have each group corresponding to each column and on top of that you have some more group levels. This way, I cannot use sort and filter options.

I am just looking for grouping more than one column and grouping those groups into sub groups again and do the same for one more level. To understand this, I have attached one drawing,

Thanks,
Roby
0
Accepted
Vera
Telerik team
answered on 31 Jan 2012, 10:24 AM
Hello Roby,

I have modified my colleague's sample project according to your requirements. Please, take a look at it. 
In order to group two or more columns into one column group you only need to set their ColumnGroupName property to the same column group name.

Let me know in case you need any further assistance.

Kind regards,
Vera
the Telerik team

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

0
Roby
Top achievements
Rank 1
answered on 31 Jan 2012, 10:47 AM
Hi Veram

Thanks a lot for this. This is what I am looking for. Thanks again.

Thanks,
Roby
Tags
GridView
Asked by
Roby
Top achievements
Rank 1
Answers by
Pavel Pavlov
Telerik team
Roby
Top achievements
Rank 1
Vera
Telerik team
Share this question
or