Change header row color

Hi once again,


I need help on changing the default header row color of SfDataGrid. I looked over the properties of 

SfDataGrid but I didn'nt find anything related to colors.


Thanks in advance.


5 Replies

RS Renugadevi Sadagoban Syncfusion Team July 2, 2021 05:41 AM UTC

Hi Xavier,
Greetings from syncfusion.
You can give a color to header by using headerColor property of SfDataGridThemeData in SfDataGridTheme.
Refer the following code snippet,
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Syncfusion Flutter DataGrid'),
),
body: SfDataGridTheme(
data:SfDataGridThemeData(
headerColor: Colors.red[200]
),
child: SfDataGrid(
source: employeeDataSource,
columnWidthMode: ColumnWidthMode.fill,
columns: _column
),
),
);
}



Also, We have prepared following sample for your reference,

Please let us know if you require any further assistance. we will be glad to assist you.
Regards,
Renuga devi S




XL Xavier Langa July 2, 2021 09:43 AM UTC

Very useful, as always. Thank you very much guys!



RS Renugadevi Sadagoban Syncfusion Team July 2, 2021 11:50 AM UTC

Hi Xavier, 
Thanks for your update. 
  
Please get back to us if you require any further assistance. We will be happy to assist you. 
  
Regards, 
Renuga devi S 



AA Amelito Alcuitas Jr. October 26, 2023 09:24 AM UTC

Hello, I know that this is an old ticket, but I just wanna know how to change specific header color. Like if I want the first column header to be red, and the second column to be green. Is that possible?



NY Nirmalkumar Yuvaraj Syncfusion Team October 27, 2023 10:09 AM UTC

We have considered your request as a feature. We will implement this feature in any of our upcoming releases. At the planning stage for every release cycle, we review all open features and identify features for implementation based on specific parameters including product vision, technological feasibility, and customer interest. We will let you know when this feature is implemented. We appreciate your patience until then.  


Thank you for requesting this feature and helping us define it. We are always trying to make our products better and feature requests like yours are a key part of our product growth efforts.  


You can also communicate with us regarding the open features any time using our Feature Report page.   


Feedback link:  https://www.syncfusion.com/feedback/47936/support-for-setting-custom-text-for-datapager-static-labels


If you have any more specification/suggestions to the feature request, you can add it as a comment in the portal and cast your vote to make it count.  


Loader.
Up arrow icon