Articles in this section
Category / Section

How to set style to SfDataGrid with a transparent background

1 min read

You can customize the style for SfDataGrid by using the SfDataGrid.GridStyle property. In order to style the SfDataGrid as a transparent view, you can customize the style for the SfDataGrid and return transparent in the required overrides.

In addition, you may have to set the BackgroundColor of the SfDataGrid as Transparent, since the default background color of the grid is White. Applying initial custom style does change only the styles of the grid elements. Hence the grid background has to be set to make the grid a transparent view.

Please refer the following code example to style the SfDataGrid as a Transparent.

sfGrid = new SfDataGrid();
sfGrid.BackgroundColor = Color.Transparent;
sfGrid.GridStyle = new TransparentStyle ();public class TransparentStyle: DataGridStyle
{
    public override Color GetRecordBackgroundColor()
    {
        return Color.Transparent;
    }
}

Please refer the following screenshot for the final output


Please refer the following UG link to know more about applying styles to SfDataGrid.
UG Link : http://help.syncfusion.com/xamarin/sfdatagrid/styles

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied