We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

expand/collapse column with click on cell

Thread ID:





127789 Dec 8,2016 07:06 PM UTC Dec 9,2016 09:05 AM UTC WPF 3
Tags: PivotGridControl
Harald Betzler
Asked On December 8, 2016 07:06 PM UTC


I'm looking for a solution to cover the following requirements:

The initial SfDataGrid looks like

After click (or double click) on "Summary A" the four columns "Type A 1-1", "Type A 1-2", "Type A 2-1" and "Type A 2-2" will be expanded

As you can see, there are 3 StackedHeaderRows with "Item", "Group" and "Type/Comment"

After click on "Summary B" the same will happen with "Type B 1-1", ...

Than each "Type"-column can be expanded with click. 

See the grid after click on "Type A 1-2"

Or after clicks on "Type A 2-2", "Type B 1-1", "Type B 1-2" and "Type B 2-2"

Or after clicks on all "Type"-columns

Further clicks on the same cell should lead to collapsed columns.

I've already tried a lot of experiments, so it would be great, if you could help with a sample. 
Please implement also the fore- and background colors.


Harald Betzler
Replied On December 8, 2016 07:08 PM UTC

I think the embedded images won't appear correctly.

Please find attached screenshots

Attachment: screenshots_ba251df7.zip

Harald Betzler
Replied On December 8, 2016 08:37 PM UTC

An additional requirement is the fact, that the number of Items ("Item A", "Item B", and so on) is dynamic.
So the columns need to be generated by AutoGenerateColumns="True".

Jai Ganesh S [Syncfusion]
Replied On December 9, 2016 09:05 AM UTC

Hi Harald, 
We have analyzed your query and we cannot achieve your requirement using SfDataGrid. However, you can achieve this by using PivotGrid. 
Jai Ganesh S 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon