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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Changing the Background and Font Color of the Grouped Column

Thread ID:

Created:

Updated:

Platform:

Replies:

147018 Aug 29,2019 12:42 AM UTC Aug 29,2019 10:48 AM UTC Xamarin.Forms 1
loading
Tags: SfDataGrid
Cezar
Asked On August 29, 2019 12:42 AM UTC

How to Change the Background and Font Color of the Grouped Column on SfDataGrid? 

The Default Background Color is Gray and I want to remove the Bold from the Font.

Is that possible?




Shivagurunathan Kamalakannan [Syncfusion]
Replied On August 29, 2019 10:48 AM UTC

Hi Cezar,   
   
Thank you for contacting Syncfusion Support.   
   
Your requirement to customize the Caption summary row can be achieved by overriding the OnInitializeDisplayView() method. You can also customize the default background color, text color and font attributes for the caption summary row based on your requirement.   
   
Pease refer the below code snippet.   


  
 
public partial class MainPage : ContentPage   
{   
               public MainPage()   
               {   
                              InitializeComponent();   
                              dataGrid.CellRenderers.Remove("CaptionSummary");   
                              dataGrid.CellRenderers.Add("CaptionSummary", new CustomGroupRenderer());   
               }                                
}   
public class CustomGroupRenderer : GridCaptionSummaryCellRenderer   
{   
               public CustomGroupRenderer()   
               {   
               }   
               public override void OnInitializeDisplayView(DataColumnBase dataColumn, SfLabel view)   
               {   
                              base.OnInitializeDisplayView(dataColumn, view);   
                              view.FontAttributes = FontAttributes.None;   
                              view.BackgroundColor = Color.Tomato;   
                              view.TextColor = Color.White;   
               }   
}   


  
 
    
We have prepared a sample based on your requirement and it can be downloaded from the below link.   
 
Please get back to us if you require further assistance from us.  
 
Regards,   
Shivagurunathan  


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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

Live Chat Icon For mobile
Live Chat Icon