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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Why is SfDataGrid.GridStyle.HeaderBackground deprecated & How to set HeaderBackground right

Thread ID:

Created:

Updated:

Platform:

Replies:

122136 Feb 19,2016 10:22 AM UTC Feb 24,2016 11:36 AM UTC Xamarin.Android 3
loading
Tags: SfDataGrid
Denis Lapiner
Asked On February 19, 2016 10:22 AM UTC

Why is SfDataGrid.GridStyle.HeaderBackground deprecated in Syncfusion Xamarin.Android (13.4.0.58)?

What is the right way to set SfDataGrid.GridStyle.HeaderBackground from code without using HeaderBackground? There is no SetHeaderBackground method?

Harikrishnan N [Syncfusion]
Replied On February 22, 2016 12:50 PM UTC

Hi Denis,

Thank you for using Syncfusion Products.

The properties in DataGridStyle class are marked obsolete and override methods are exposed instead. This was done in our 13.3.0.18 release and was also mentioned in our service pack release notes and main volume release notes.

ServicePack release notes: http://files2.syncfusion.com/Installs/v13.3.0.18/ReleaseNotes/Xamarin_Android.html#Xamarin_Android-Grid
Main volume release notes: http://help.syncfusion.com/xamarin/release-notes/xamarin-android/v13.4.0.53

The right way to customize the header background color is to write a custom style for the SfDataGrid. Please refer the below code example.



SfDataGrid dataGrid = new SfDataGrid();
dataGrid.GridStyle = new CustomStyle();

public class CustomStyle : DataGridStyle

{

    public CustomStyle()

    {


    }


    public override Color GetHeaderBackgroundColor ()

    {

        return Color.Yellow;

    }


}


For more details about writing custom styles for SfDataGrid please check our below user documentation link.

UG link: http://help.syncfusion.com/xamarin/sfdatagrid/styles

Regards,
Harikrishnan


Denis Lapiner
Replied On February 23, 2016 07:44 AM UTC

Thanks for the detailed information!

Harikrishnan N [Syncfusion]
Replied On February 24, 2016 11:36 AM UTC

Hi Denis,

Thanks for the update.

Please let us know if you require further assistance on this.

Regards,
Harikrishnan


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

;