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

SfDataGrid - Header row height

Hello,

 

Is there any way to set header row height independently of data row height?

I've tried to set RowHeight property of the SfDataGrid control and also change style for the HeaderRowControl, but it has not helped.

 

 

 


8 Replies

AS Arun Selva Kumar B Syncfusion Team March 22, 2013 09:31 AM UTC

Hi Alexey,

 

Thank you for using Syncfusion Products.

 

RowHeight Property of SfDataGrid is used to set height for the data rows except the header row. 

 

HeaderRowHeight property can be used to set height for header row independent of data rows in SfDataGrid.  We have also attached a Code Snippet for your reference.

 

CODE SNIPPET:

            <Grid:SfDataGrid x:Name="SyncGrid"

                             AllowResizeColumns="True"

                             AutoGenerateColumns="True"

                             ItemsSource="{Binding Path=Countlist}"

                             ColumnSizer="AutoWithLastColumnFill"

                             HeaderRowHeight="80"

                             SelectionMode="Single">

            </Grid:SfDataGrid>

 

Please let us know, if you need further assistance on this.

 

With Regards,

Arun Selva Kumar



GP Gary Pansino March 22, 2013 04:29 PM UTC

A related question... how do we wrap text in header and body cells?


AL Alexey March 25, 2013 02:28 AM UTC

Hello,

 

After set HeaderRowHeight="80" I get following exception:

System.ArgumentOutOfRangeException
   at Syncfusion.WinRT.ScrollAxis.DistanceRangeCounterCollection.CheckRange(String paramName, Int32 from, Int32 to, Int32 actualValue)
   at Syncfusion.WinRT.ScrollAxis.DistanceRangeCounterCollection.SetRange(Int32 from, Int32 to, Double distance)
   at Syncfusion.WinRT.ScrollAxis.LineSizeCollection.InitializeDistances()
   at Syncfusion.WinRT.ScrollAxis.LineSizeCollection.get_Distances()
   at Syncfusion.WinRT.ScrollAxis.PixelScrollAxis.get_Distances()
   at Syncfusion.WinRT.ScrollAxis.PixelScrollAxis..ctor(IScrollBar sb, ILineSizeHost scrollLinesHost, IDistancesHost distancesHost)
   at Syncfusion.UI.Xaml.Grid.VisualContainer.CreateScrollAxis(Orientation orientation, Boolean pixelScroll, IScrollBar scrollBar, ILineSizeHost lineSizes)
   at Syncfusion.UI.Xaml.Grid.VisualContainer.get_ScrollRows()
   at Syncfusion.UI.Xaml.Grid.VisualContainer.UpdateAxis(Size availableSize)
   at Syncfusion.UI.Xaml.Grid.VisualContainer.MeasureOverride(Size constraint)
   at Windows.UI.Xaml.FrameworkElement.MeasureOverride(Size availableSize)
   at Syncfusion.UI.Xaml.Grid.ScrollableContentPresenter.MeasureOverride(Size availableSize)
   at Windows.UI.Xaml.UIElement.Measure(Size availableSize)
   at Syncfusion.UI.Xaml.Grid.ScrollableContentViewer.MeasureOverride(Size availableSize)   at Windows.UI.Xaml.FrameworkElement.MeasureOverride(Size availableSize)
   at Syncfusion.UI.Xaml.Grid.SfDataGrid.MeasureOverride(Size availableSize)



AS Arun Selva Kumar B Syncfusion Team March 25, 2013 12:49 PM UTC

Hello Alexey,

We tried to set different values for HeaderRowHeight with our sample, but were unable to reproduce the issue.  We have attached our Sample with this response, please modify the sample based on your application along with the replication procedure.  This would be helpful for  us to investigate  the issue further.

Sample :

Looking forward to your reply

Regards,
Arun Selva Kumar



TestApp_bbcd5512.zip


AS Arun Selva Kumar B Syncfusion Team March 25, 2013 12:50 PM UTC

Hello Alexey,

We tried to set different values for HeaderRowHeight with our sample, but were unable to reproduce the issue.  We have attached our Sample with this response, please modify the sample based on your application along with the replication procedure.  This would be helpful for  us to investigate  the issue further.

Looking forward to your reply

Regards,
Arun Selva Kumar



TestApp_c274d080.zip


AS Arun Selva Kumar B Syncfusion Team March 25, 2013 01:04 PM UTC

Hi Gary,

You can use Styles to Wrap the Text in both header and body cells.

Kindly refer the following Code Snippet.

GridCell Template:

<Style x:Key="cellStyle" TargetType="syncfusion:GridCell">

            <Setter Property="Template">

                <Setter.Value>

                    <ControlTemplate TargetType="syncfusion:GridCell">

                        <Border BorderBrush="Gray" BorderThickness="0,0,1,1">

                            <Grid>

                                <TextBlock Text="{Binding EmployeeDesignation}" TextWrapping="Wrap" />

                            </Grid>

                        </Border>

                    </ControlTemplate>

                </Setter.Value>

            </Setter>

        </Style>

 

HeaderCellsControl Template:

<Style x:Key="headerStyle" TargetType="syncfusion:GridHeaderCellControl">

            <Setter Property="Template">

                <Setter.Value>

                    <ControlTemplate TargetType="syncfusion:GridHeaderCellControl">

                        <Border BorderBrush="LightGray"

                                BorderThickness="1">

                            <Grid>

 

                                <TextBlock Grid.Column="0"

                                           HorizontalAlignment="Center"

                                           VerticalAlignment="Center"

                                           FontSize="14"

                                           FontWeight="SemiBold"

                                           Foreground="White"

                                           TextWrapping="Wrap"

                                           Text="{Binding MappingName}" />

                            </Grid>

                        </Border>

                    </ControlTemplate>

                </Setter.Value>

            </Setter>

        </Style>

 

We had also attached a sample for your reference


With Regards,

Arun Selva Kumar



TextWrapping_c55f0562.zip


AL Alexey March 26, 2013 01:53 AM UTC

Hello,

 

The example is in attachment.

I also tried install the latest service pack (11.1.0.22 - http://www.syncfusion.com/downloads/winrt-service-packs), but it didn't help.

BTW, I accidentally found that service pack is available by other forum thread (http://www.syncfusion.com/support/forums/winrt/107928/LineSeries-itemssource-issue)

Was there any news about this?



TestApp_bbcd5512_modified_4a8776c2.zip


AS Arun Selva Kumar B Syncfusion Team March 26, 2013 11:16 AM UTC

Hello Alexey,

 

Thank you for reporting this issue.

 

We have created a new incident #106156 under your account to access this details, could you please check the Incident for assemblies updates and fix your issue.

 

Kindly get back to us if you need any further assistance.

 

Regards,

Arun Selva Kumar

Loader.
Live Chat Icon For mobile
Up arrow icon