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.
Unfortunately, activation email could not send to your email. Please try again.

Missing GroupCaption in SfDataGrid

Thread ID:

Created:

Updated:

Platform:

Replies:

127602 Nov 27,2016 01:52 PM Dec 7,2016 11:34 PM WPF 5
loading
Tags: SfDataGrid
Harald Betzler
Asked On November 27, 2016 01:52 PM

Hi,

I've the problem, that my SfDataGrid displays groups as defined in GroupColumnDescriptions, but without any Text when the SfDataGrid is within a TabItem.

If the same SfDataGrid is moved outside the TabControl the group captions are displayed correctly, but not in the TabControl.

I wanted to prepare a simple sample. But there I'm not able to reproduce the problem. So where is the reason for this behavior?

Please find the two attached screenshots (one with correct and one without group caption)

Regards

Harald

Jai Ganesh S [Syncfusion]
Replied On November 28, 2016 06:54 AM

Hi Harald, 
 
We have checked your reported issue in our sample but we also not replicate the issue.  
 
 
Also, we didn’t find any screnshots for this issue as you mentioned your query. Could you please share more details like whether you have used any styles in your application also if possible can you please share the xaml and class files to replicate the issue. This would be more helpful for us to analyze further. 
 
Regards, 
Jai Ganesh S 


Harald Betzler
Replied On November 29, 2016 04:47 AM

Hi Jai,

I discovered two reasons.

1. A style of the surrounding TabItem sets Foreground="White" and Background="Red", which results to a GroupColumnDesciption with White-On-White. Ok, that's not really an issue. But, why is foreground inherited and not background?

2. The GroupColumnDescription is empty (really empty and not White-On-White), when in AutoGeneratingColumns event the generating of the grouped column is cancelled. The result is the same, if you configure ShowColumnWhenGrouped to True or False.

Ok, you can say a not-generated-column should not be grouped. But it works. You can group by a not-generated-column, but without a GroupColumnDescription. In my opinion there should be a valid GroupColumnDescription, if a valid grouping is displayed.

I've attached a sample, where you can see the behavior.

Regards

Harald

Attachment: SfGridSample7_8833f38a.zip

Jai Ganesh S [Syncfusion]
Replied On November 30, 2016 07:16 AM

Hi Harald, 
You can achieve your requirement to show the GroupColumnDescription by hiding the column in AutoGeneratingColumn event like below, 
 
private void SampleDataGrid_AutoGeneratingColumn(object sender, AutoGeneratingColumnArgs e) 
{ 
    if (e.Column.MappingName == "ItemType") 
    { 
        e.Column.IsHidden = true; 
    } 
} 
 
Regards, 
Jai Ganesh S 


Harald Betzler
Replied On December 7, 2016 01:14 PM

Hi Jai,

that works perfectly. Thank you.

Regards
Harald

Jai Ganesh S [Syncfusion]
Replied On December 7, 2016 11:34 PM

Hi Harald, 
Thank you for the update. 
Please let us know if you need further assistance in this. 
Regards, 
Jai Ganesh S 


CONFIRMATION

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.

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.

;