Implementing Stacked Headers using Data Annotations with '/'

Hi

I am using SfDataGrid and displaying Stacked Headers using Data Annotations.

One of the Stacked Headers contains the text "Sensor/Device". So whenever I use [Display(GroupName = "Sensor/Device")], it is creating 2 Stacked Headers 'Sensor' and '/Device'.

Could you please help me resolve this issue?

I am using DataAnnotations because I have to display custom controls in SfDatagrid using 'GridTemplateColumn'. I am open to the changes in Stacked Headers without using Data Annotations.


4 Replies 1 reply marked as answer

DM Dhanasekar Mohanraj Syncfusion Team August 3, 2022 03:34 PM UTC

Hi Swapnil Walwadkar,

Currently, we can able to reproduce the reported issue on our end. We need to validate the reported issue. We will check and update you on further details on August 5, 2022.

We appreciate your patience until then.

Regards,
Dhanasekar M.



DM Dhanasekar Mohanraj Syncfusion Team August 5, 2022 02:38 PM UTC

Hi Swapnil Walwadkar,

Still, we are working on this. We need two more business days to validate this. We will update you with further details on or before
August 09, 2022.

We appreciate your patience and understanding.

Regards,
Dhanasekar M.



DM Dhanasekar Mohanraj Syncfusion Team August 9, 2022 03:33 PM UTC

Hi Swapnil Walwadkar,

Sorry for the inconvenience caused.

Still, we are working on this. We will check and update you on further details on August 11, 2022.

We appreciate your patience and understanding.


Regards,

Dhanasekar M.



DM Dhanasekar Mohanraj Syncfusion Team August 10, 2022 06:18 AM UTC

Hi Swapnil Walwadkar,


We have analyzed the reported issue on our end. This is the behavior of the SfDataGrid. When you give the GroupName DataAnnotation with “/”, the stacked header will be added to specific columns by splitting the  “/”. However, you can add the stacked headers with “/” by adding StakedHeaderRows manually shown below,

<syncfusion:SfDataGrid.StackedHeaderRows>

        <syncfusion:StackedHeaderRow>

            <syncfusion:StackedHeaderRow.StackedColumns>

                <syncfusion:StackedColumn ChildColumns="OrderID,CustomerID,CustomerName,ShipCity,Country" HeaderText="Sales Details" MappingName="SalesDetails"/>

            </syncfusion:StackedHeaderRow.StackedColumns>

        </syncfusion:StackedHeaderRow>

        <syncfusion:StackedHeaderRow>

            <syncfusion:StackedHeaderRow.StackedColumns>

                <syncfusion:StackedColumn ChildColumns="OrderID" HeaderText="Order ID/Order Details " MappingName="OrderDetails"/>

                <syncfusion:StackedColumn ChildColumns="CustomerID,CustomerName" HeaderText="Customer Details" MappingName="CustomerDetails"/>

                <syncfusion:StackedColumn ChildColumns="ShipCity,Country" HeaderText="Shipping Details" MappingName="ShippingDetails"/>

            </syncfusion:StackedHeaderRow.StackedColumns>

        </syncfusion:StackedHeaderRow>

    </syncfusion:SfDataGrid.StackedHeaderRows>


For more information related to Stacked headers, please refer to the below user guide documentation link,

UG Link: https://help.syncfusion.com/wpf/datagrid/stacked-headers

Please let us know if you have any concerns about this.

Regards,
Dhanasekar M.


If this post is helpful, please consider Accepting it as the solution so that other members can locate it more quickly.







Marked as answer
Loader.
Up arrow icon