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.
Syncfusion Feedback

StackedHeaderRows not working as expected

Thread ID:

Created:

Updated:

Platform:

Replies:

132843 Sep 25,2017 09:59 AM UTC Sep 26,2017 01:29 PM UTC WPF 1
loading
Tags: SfDataGrid
BAO YADONG
Asked On September 25, 2017 09:59 AM UTC

Hi,

I have refer to your documentation of StackedHeaderRows sample, but i can't get this feature to work properly.

<sync:SfGrid>
...
<sync:SfDataGrid.StackedHeaderRows>
<sync:StackedHeaderRow>
<sync:StackedHeaderRow.StackedColumns>
<sync:StackedColumn ChildColumns="PatientID, PatientName" HeaderText="Employee Details"/>
</sync:StackedHeaderRow.StackedColumns>
</sync:StackedHeaderRow>
</sync:SfDataGrid.StackedHeaderRows>

<sync:SfDataGrid.Columns>
<sync:GridTextColumn HeaderText="Visit Date" MappingName="VisitDate" TextAlignment="Left" Width="100">
...
</sync:GridTextColumn>
<sync:GridTextColumn HeaderText="Patient ID" MappingName="PatientID" TextAlignment="Left" Width="100">
<sync:GridTextColumn.CellTemplate>
<DataTemplate>
<Border >
<TextBlock Padding="3,0,0,0" FontWeight="Regular" FontSize="13" Text="{Binding Path=ID}" VerticalAlignment="Center"/>
</Border>
</DataTemplate>
</sync:GridTextColumn.CellTemplate>
</sync:GridTextColumn>
<sync:GridTextColumn HeaderText="Patient Name" MappingName="PatientName" TextAlignment="Left" Width="100">
...
</sync:GridTextColumn>
<sync:GridTextColumn HeaderText="Diagnosis" MappingName="Diagnosis" TextAlignment="Left" Width="100">
...
</sync:GridTextColumn>
</sync:SfDataGrid.Columns>
</sync:SfGrid>

My final grid look so weird that it has a line in between 2 rows. Please see the attached image.

I have not try the GroupName option, but do i need to specify the StackedHeaderRows if i'm using the GroupName option?


Attachment: Capture_3815dd8d.rar

Gnanasownthari Thirugnanam [Syncfusion]
Replied On September 26, 2017 01:29 PM UTC

Hi BAO, 

On analyzing your given screenshot we suspect that you are applying style for GridHeaderCellControl and HeaderRowControl. But this is incorrect use case as per our control design so you need to write style for GridStackedHeaderCellControl and GridHeaderCellControl as like below code example. 

XAML 
<Window.Resources> 
    <Style TargetType="syncfusion:GridStackedHeaderCellControl">             
       <Setter Property="BorderBrush" Value="SkyBlue"/> 
    </Style> 
    <Style TargetType="syncfusion:GridHeaderCellControl"> 
       <Setter Property="BorderBrush" Value="SkyBlue"/> 
    </Style> 
</Window.Resources> 

We have prepared the sample for same, you can download the same from below mentioned location. 

Sample location: 


Please refer the below UG link for more details about SfDataGrid control design. 

Please let us know if you have any further assistance on this. 

Regards, 
Gnanasownthari T. 
 


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

;