updateScrollerViewBackground seems to not be applied correctly at all times - Kind of a high priority

I have a page with multiple tabs on it and a grid on each tab.

When the view is shown the background color of the data grid is the same as the background color specified in my override of  GetRecordBackgroundColor on the first tab.

On the successive tabs it colors the background color of the column correctly but not the data grid background .. it is white, GetRecordBackgroundColor is invoked by updateScrollerViewBackground but not applied for some reason.

Any idea on how to resolve this issue or what might cause it ?



3 Replies

JA Jayaraman Ayyanar Syncfusion Team August 28, 2018 09:51 AM UTC

 
Thank for contacting syncfusion support. 
 
We have analyzed the reported query for displaying the background color of the DataGrid when placed inside a layout or container which has a background color other than white. You 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. Refer the below code examples. 
 
sfGrid = new SfDataGrid(); 
sfGrid.BackgroundColor = Color.Transparent; 
sfGrid.GridStyle = new TransparentStyle(); 
 
public class TransparentStyle: DataGridStyle 
{ 
    public override Color GetRecordBackgroundColor() 
    { 
        return Color.Transparent; 
    } 
} 
 
 
You can also refer the KB link in the following  
 
 
Regards, 
Jayaraman. 



SH Stephen Hauck August 28, 2018 12:47 PM UTC

Sorry, I made a comment on the article instead of replying to this ticket, can you remove it please?

We have 3 grids ... the background color is applied appropriately to the first one but not the next two.

There is something that is not firing or being applied correctly on the second and third grids.

If I move the grids around it's always the first one that works and not the two successive ones.

Does the application of the record background color depend on things like visibility of the control? It should not but something is not being applied correctly.

I can see your grid calling for the color ( updateScrollerViewBackground ) but it seems it is not being applied correctly.



DY Deivaselvan Y Syncfusion Team August 29, 2018 06:08 PM UTC

Hi Stephen,

The issue that the background color of the SfDataGrid does not get applied correctly could not be reproduced on our side. The background color updates correctly in SfDataGrid. We have attached the sample in which we have tested the issue and you can download the same sample from below link.

Sample link: http://www.syncfusion.com/downloads/support/directtrac/general/ze/Custom_Font-1382523503

We have also provided you the working video in the below link:

Video link: http://www.syncfusion.com/downloads/support/directtrac/general/ze/TabItemsAsGrid-1853713838

Regards,
Deivaselvan 


Loader.
Up arrow icon