Set header row height independent of row height

I have an SfGrid where I set RowHeight="70". This also makes the Header Row 70. How can I set the header row height to be a different value - for example 35px?

3 Replies 1 reply marked as answer

RN Rahul Narayanasamy Syncfusion Team February 8, 2021 11:39 AM UTC

Hi Judi, 

Greetings from Syncfusion. 

Query: Set header row height independent of row height - I have an SfGrid where I set RowHeight="70". This also makes the Header Row 70. How can I set the header row height to be a different value - for example 35px? 

We have validated your query and we suggest you to achieve your requirement by using below CSS. Find the below code snippets and sample for your reference. 

 
<SfGrid DataSource="@Orders" Height="280" RowHeight="70"> 
    <GridColumns> 
        <GridColumn Field=@nameof(Order.OrderID) HeaderText="OrderID" Width="110"> </GridColumn> 
        . . . 
    </GridColumns> 
</SfGrid> 
 
@code { 
 
    public List<Order> Orders { get; set; } 
 
    . . . 
} 
 
<style> 
    .e-grid th.e-headercell { 
        height: 35px !important;     //for setting height for header row 
    } 
</style> 

Sample: 

Please let us know if you have any concerns. 

Regards, 
Rahul 


Marked as answer

JS Judi Smith February 8, 2021 06:16 PM UTC

Thank you. That works.


RN Rahul Narayanasamy Syncfusion Team February 9, 2021 05:28 AM UTC

Hi Judi, 

Thanks for the update. 

We are happy to hear that the provided solution was helpful to achieve your requirement. 

Please get back to us if you need further assistance. 

Regards, 
Rahul 


Loader.
Up arrow icon