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

[Solved] How to collapse all the headers in a RadGrid

6 Answers 286 Views
Grid for XAML
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Rajesh
Top achievements
Rank 1
Rajesh asked on 19 Jun 2014, 10:34 AM
Hi,

I am using a RADGrid and applied a GroupDescriptor to sort the data based on a certain field.

By default all the groups are expanded in the grid. I want ALL the groups to be collapsed by default and also at a time only one group can be expanded which means means if I select the first group, it expands while the others remain closed. Now I select the second group, it should expand while the first group should collapse.

How can I achieve this functionality.

Looking forward to hearing a feasible solution for this.

Also I want to change the colour of each header in the RAD Grid from grey to some other colour both for the column header and the grouped header.

Thanks,

Rajesh.

6 Answers, 1 is accepted

Sort by
0
Rosy Topchiyska
Telerik team
answered on 23 Jun 2014, 10:31 AM
Hi Rajesh,

Thank you for contacting us.

I have attached a sample project that demonstrates how to collapse the grid groups and style the headers. You can use a custom GroupHeaderTapCommand in which using the grid DataView you can collapse the groups. You can style the group headers with the GroupHeaderStyle property. The header of each column can be styled using the DataGridColumn.HeaderStyle property.

I hope this helps. Please, let us know if you have further questions.

Regards,
Rosy Topchiyska
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Rajesh
Top achievements
Rank 1
answered on 24 Jun 2014, 10:13 AM
Hi Rosy,

Thanks a lot for the solution and I had a look at your example and it worked fine. 

When trying to implement the same in my project I observed the following issues.

1. My project was compiled for x64  and it includes a 64-bit version of a SQLite database to access data from.

2. When including this fragment of code 
<telerikGrid:RadDataGrid.Commands>
     <local:CustomGroupHeaderTapCommand />
</telerikGrid:RadDataGrid.Commands>

It displayed this error "Error 6 The name "CustomGroupHeaderTapCommand" does not exist in the namespace "using:Inspection_Grid"

Screen shot attached for your reference. 

On careful comparison with your example I noticed that your sample was compiled for x86 and hence it worked.

A similar issue (http://stackoverflow.com/questions/15051121/the-name-does-not-exist-in-the-current-in-the-namespace-clr-namespace) explains the cause and none of the changes worked for me to overcome this issue. 

And the code is similar to <local:> and that is what causes this bug in 64-bit XAML designer in Visual Studio 2013.

I cannot switch to x86 because I am using a 64-bit version of SQLite database with this application.

Kindly let me know if there is any work around for this issue to make the code work. Please note that the same bug happens for the Custom Sorting (http://www.telerik.com/forums/custom-grouping-using-delegategroupdescriptor) filed by me.

Thanks,

Rajesh.
0
Rajesh
Top achievements
Rank 1
answered on 24 Jun 2014, 10:24 AM
Hi,

Thanks for explaining how to change the header column and group header columns for the grid. 

I am attaching a screen shot since I am unable to change the Service Column and Service Column Flyout. 

I went through this article http://www.telerik.com/help/windows-8-xaml/datagrid-styling-teleriknamedbrushes.html and http://www.telerik.com/help/windows-8-xaml/common-teleriknamedbrushes.html but unable to achieve this. 

Kindly let me know how to change the Service Column and Service Column Flyout. 

Thanks,

Rajesh








0
Accepted
Dimitrina
Telerik team
answered on 26 Jun 2014, 08:58 AM
Hello Rajesh,

Please find attached a project that demonstrates  how to change the Service Column and Service Column Flyout. More information about how to change resource can be found here.

I hope this helps. Let me know if you have further questions.  

Regards,
Dimitrina
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Rajesh
Top achievements
Rank 1
answered on 26 Jun 2014, 09:52 AM
Hello Dimitrina,

Thanks a lot for this help and now it is clear how to override the colours of the Telerik Named Brushes.

But I would like to let you know that the documentation (http://www.telerik.com/help/windows-8-xaml/common-resolvingteleriknamedresources.html) is not clear and this needs to be re-written so that the user will know that he has to create the Theme folder, add 2 files Dark and Light, specify ONLY the controls that he wants to modify in these 2 files and then reference this in the App.xaml file.

Hope that you will let the documentation team know this, so that they can make it simple and easy to understand.

Thanks,

Rajesh.
0
Ivaylo Gergov
Telerik team
answered on 30 Jun 2014, 03:04 PM
Hi Rajesh,

Thank you for feedback regarding our help resources.

Using Themes folder is not requirement - you can assign the path of the files through the UserThemeResources.DarkResourcesPath and  UserThemeResources.LightResourcesPath properties. In this case, we used the folder so that the files are better organized.

In addition we will elaborate better the idea that  "where ControlNamespace is the specific namespace where the control you restyle is defined". Generally, you can add all the namespaces that contain UI controls for Windows 8, but only these that contain controls that you restyle will make sense. 

Thank you again for the provided feedback.

Regards,
Ivaylo Gergov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Grid for XAML
Asked by
Rajesh
Top achievements
Rank 1
Answers by
Rosy Topchiyska
Telerik team
Rajesh
Top achievements
Rank 1
Dimitrina
Telerik team
Ivaylo Gergov
Telerik team
Share this question
or