The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
Hi,
we would like to have a background image in our grid control, and at the same time the capability to change the cell background color of any cell. It seems that if a backgroud image is specified, then the cell background color can''t change.
Any suggestion ?
Thanks in advance
Riccardo
ADAdministrator Syncfusion Team March 16, 2006 06:48 AM UTC
Hi Riccardo,
Setting the BackgroundImage will set the TransparentBackground property to true and this has the higher precedence over the backcolor property. Hence this causes the issue. To have both image and backcolor, you can use the FillRectangle method in the DrawCell event. Here is the code snippet.
private void gridControl1_DrawCell(object sender, Syncfusion.Windows.Forms.Grid.GridDrawCellEventArgs e)
{
if(e.RowIndex == 4)
{
SolidBrush br = new SolidBrush(Color.PaleGreen);
e.Graphics.FillRectangle(br, e.Bounds);
br.Dispose();
}
}
Let us know if this helps.
Best regards,
Madhan.