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.
I would like to be able to set the CurrentCell''s background color without having to handle the QueryCellInfo event.
I tried:
gdbg.Model[rowNdx, colNdx].BackColor = Color.Plum;
where rowNdx and colNdx point to the CurrentCell, but no color is ever set.
ADAdministrator Syncfusion Team January 10, 2006 05:51 AM UTC
Hi,
you can use PrepareViewStyleInfo Event for changing the current cell''s background color of GDBG. Here is the Code snippet.
private void gridControl1_PrepareViewStyleInfo(object sender, GridPrepareViewStyleInfoEventArgs e)
{
if(e.ColIndex == 3 && e.RowIndex == 3)
e.Style.BackColor = Color.Yellow;
}
Refer this KB article for more details.
http://www.syncfusion.com/support/kb/grid/Default.aspx?ToDo=view&questId=84
With Regards,
Madhan
STstanleyj Syncfusion Team January 10, 2006 06:53 AM UTC
Hi,
To have only the current cell to be of any color, then CurrentCell.HasCurrentCellAt(e.RowIndex, e.ColIndex) has to be checked in the PrepareViewStyleInfo or QueryCellInfo handler.
if(this.gridDataBoundGrid1.CurrentCell.HasCurrentCellAt(e.RowIndex, e.ColIndex))
{
e.Style.BackColor = Color.Pink;
}
Best regards,
Stanley
JMJay MooneyJanuary 10, 2006 02:51 PM UTC
I was looking for a way to do this outside of any event. Looks like maybe that can''t be done.