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

Background color for empty SfDataGrid

Thread ID:

Created:

Updated:

Platform:

Replies:

141063 Nov 21,2018 06:53 AM UTC Dec 4,2018 10:05 AM UTC WinForms 9
loading
Tags: SfDataGrid
Adam
Asked On November 21, 2018 06:53 AM UTC

Hi

How to change BG Color for empty SfDataGrid from standard white to other one?

Deivaselvan Y [Syncfusion]
Replied On November 22, 2018 10:48 AM UTC

Hi Adam,

Thank you for contacting Syncfusion support.

You can set the Background color of the DataGrid when its empty using the below code example.

 
this.sfDataGrid.TableControl.BackColor = Color.Red; 

Please let us know if you have any other questions.

Regards,
Deivaselvan 


Adam
Replied On November 22, 2018 07:22 PM UTC

Hi
Thanks for the answer... now it´s working well I change the BG for example Red but I have still a "white hole" in my SfDataGrid (see Attach).
By which element I muss more change the BG Color?

regards
Adam


Attachment: 20181123_at_021437_b4565cf0.zip

Deivaselvan Y [Syncfusion]
Replied On November 23, 2018 08:59 AM UTC

Hi Adam,

Thanks for the update.

On analyzing with the given image, we have found that the reported “white hole” denotes the indent cell of the group. Our proposed code will set Background color only to the DataGrid area and it should not apply to each type of cell. To meet your requirement, you should set same Background color to all the type of elements which is shown as white. Please refer the below code example which meet your requirement.

 
this.sfDataGrid.TableControl.BackColor = Color.Red; 
this.sfDataGrid.Style.GroupDropAreaStyle.BackColor = Color.Red; 
this.sfDataGrid.Style.IndentCellStyle.BackColor = Color.Red; 

Please let us know if you have any other questions.

Regards,
Deivaselvan 


Adam
Replied On November 29, 2018 03:15 PM UTC

P-E-R-F-E-C-T

1000 Thanks :-)

Deivaselvan Y [Syncfusion]
Replied On November 30, 2018 06:29 AM UTC

Hi Adam,

Thanks for your feedback. We are happy to assist you as always. Please let us know if you require any further assistance.

Regards,
Deivaselvan 


Adam
Replied On November 30, 2018 07:45 PM UTC

Hi
I found one more "white hole" and hope will be the last :-D

Please with witch method cane I change the BackColor?

Thanks for Help

Attachment: LastWhiteHole_66f8c663.zip

Deivaselvan Y [Syncfusion]
Replied On December 3, 2018 09:24 AM UTC

Hi Adam, 

Thanks for your update. 

Currently we don’t have direct support to change the back color of the size grip in the DataGrid. We don’t have any immediate plans to provide this support. At the planning stage for every release cycle, we review all open features.  We will let you know when this feature is implemented. 

However, we have a workaround to change the size grip color. Please refer the following code example and sample from the given location. 

Code Example :  

var sizeGrip = ReflectionHelper.GetProperty(this.sfDataGrid.TableControl.Style.GetType(), "SizeGrip").GetValue(this.sfDataGrid.TableControl.Style, null); 
ReflectionHelper.GetProperty(sizeGrip.GetType(), "BackColor").SetValue(sizeGrip, Color.Red, new object[] { }); 


Regards, 
Deivaselvan 


Adam
Replied On December 4, 2018 08:13 AM UTC

SENSATIONAL !
You are my Hero. Thank you very much :-)

Adam

Deivaselvan Y [Syncfusion]
Replied On December 4, 2018 10:05 AM UTC

Hi Adam,

Thanks for the appreciation.

Regards,
Deivaselvan 


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