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. Image for the cookie policy date
close icon

Combine Groups and Header Text

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?

3 Replies

MG Mohanraj Gunasekaran Syncfusion Team 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  



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

I am using WPF SFDATAGRID.


BR Balamurugan Rajaraman Syncfusion Team 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 


Loader.
Live Chat Icon For mobile
Up arrow icon