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

Combine Groups and Header Text

Thread ID:

Created:

Updated:

Platform:

Replies:

130308 May 5,2017 10:30 AM UTC May 10,2017 12:21 PM UTC WPF 3
loading
Tags: SfDataGrid
Corey James Carney
Asked On May 5, 2017 10:30 AM UTC

Hello,

I currently have a layout grouped into categories like this: http://i.imgur.com/fdW2fVe.png

I'd like to be able to still group the Delivery Address P.O: and the S.O but instead of it extending i'd like it in one tab such as

P.O : 2 S.O : 2 - Delivery Address - 2 items

Is it possible?

Mohanraj Gunasekaran [Syncfusion]
Replied On May 8, 2017 01:34 PM UTC

Hi Corey, 
 
Thanks for using Syncfusion product. 
 
We have analyzed your provided screenshot. By your screenshot, we know that you have used the grouping grid. Can you please confirm whether you are using WPF – SfDataGrid or different control. If you are using different control, please provide that control details. It will be helpful to provide the solution at the earliest. 
 
Regards, 
Mohanraj G  


Corey James Carney
Replied On May 9, 2017 07:44 AM UTC

I am using WPF SFDATAGRID.

Balamurugan Rajaraman [Syncfusion]
Replied On May 10, 2017 12:21 PM UTC

Hi Corey 
 
We have checked your query “How to combine the Header and Column Names”. We have created the custom sample by override the CaptionSummary renderer to achieve your requirement as like the below provided code sample. 
 
protected override void OnAttached() 
        { 
            //default CaptionSummaryCellRenderer is removed.             
            this.AssociatedObject.CellRenderers.Remove("CaptionSummary"); 
 
            //Customized CaptionSummaryCellRenderer is added. 
            this.AssociatedObject.CellRenderers.Add("CaptionSummary", new CustomCaptionSummaryCellRenderer()); 
        } 
 
In that renderer we have override the OnInitializeEditElement and OnUpdateEditBinding to apply the custom text for the CaptionSummaryRow 
 
public override void OnInitializeEditElement(DataColumnBase dataColumn, GridCaptionSummaryCell uiElement, object dataContext) 
{ 
    if (dataContext is Group) 
    { 
        var groupRecord = dataContext as Group; 
        if (this.DataGrid.CaptionSummaryRow == null) 
        { 
                     
            //set the captionsummarycell text as customized. 
            uiElement.Content = GetCustomizedCaptionText(groupRecord); 
        } 
        else if (this.DataGrid.CaptionSummaryRow.ShowSummaryInRow) 
        { 
            uiElement.Content = SummaryCreator.GetSummaryDisplayTextForRow(groupRecord.SummaryDetails, 
                this.DataGrid.View); 
        } 
        else 
            uiElement.Content = SummaryCreator.GetSummaryDisplayText(groupRecord.SummaryDetails, 
                dataColumn.GridColumn.MappingName, this.DataGrid.View); 
    } 
} 
string entryText = string.Empty; 
public override void OnUpdateEditBinding(DataColumnBase dataColumn, GridCaptionSummaryCell element, object dataContext) 
{ 
    entryText = string.Empty; 
    if (element.DataContext is Group && this.DataGrid.View.GroupDescriptions.Count > 0) 
    { 
        var groupRecord = element.DataContext as Group; 
        //get the column which is grouped. 
        var groupedColumn = this.GetGroupedColumn(groupRecord); 
        if (this.DataGrid.CaptionSummaryRow == null) 
        { 
            if (this.DataGrid.View.GroupDescriptions.Count < groupRecord.Level) 
                return; 
            //set the captionsummary text as customized. 
            element.Content = GetCustomizedCaptionText(groupRecord); 
        } 
        else if (this.DataGrid.CaptionSummaryRow.ShowSummaryInRow) 
        { 
            element.Content = SummaryCreator.GetSummaryDisplayTextForRow(groupRecord.SummaryDetails, 
                this.DataGrid.View, groupedColumn.HeaderText); 
        } 
        else 
            element.Content = SummaryCreator.GetSummaryDisplayText(groupRecord.SummaryDetails, 
                dataColumn.GridColumn.MappingName, this.DataGrid.View); 
    } 
} 
 
 We have attached the sample for your reference you can able to get it from the below location. 
 
 
Please refer the below link for getting more information about the CaptionSummaryRow customization 
 
 
Regards, 
Balamurugan R 


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.

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

;