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 want to colour the whole row of the current cell to some shellow yellow, current cell bright yellow, however to leave some uneditable cell on this row not coloured.
I used some code as below:
this.RefreshCurrentCellBehavior = GridRefreshCurrentCellBehavior.RefreshRow;
protected override void OnPrepareViewStyleInfo(GridPrepareViewStyleInfoEventArgs e)
{
base.OnPrepareViewStyleInfo(e);
if (e.RowIndex > this.Model.Rows.HeaderCount && e.ColIndex > this.Model.Cols.HeaderCount
&& this.CurrentCell.HasCurrentCellAt(e.RowIndex))
{
e.Style.Interior = new BrushInfo(Color.Yellow);
}
}
How to maintain the interior colour of some cell (not editable) in the same row? and how to set the current cell colour?
STstanleyj Syncfusion Team January 7, 2006 09:10 AM UTC
Hi Hui,
By checking HasCurrentCellAt(e.RowIndex, e.ColIndex) and HasReadOnly other requirements are fulfilled.
if (e.RowIndex > gridControl1.Model.Rows.HeaderCount && e.ColIndex > gridControl1.Model.Cols.HeaderCount )
if(this.gridControl1.CurrentCell.HasCurrentCellAt(e.RowIndex))
{
e.Style.Interior = new BrushInfo(Color.LemonChiffon);
}
if(this.gridControl1.CurrentCell.HasCurrentCellAt(e.RowIndex, e.ColIndex))
{
e.Style.Interior = new BrushInfo(Color.Yellow);
}
if( e.Style.HasReadOnly)
{
e.Style.Interior = new BrushInfo(Color.White);
}
Best regards,
Stanley
HZHui ZhongJanuary 9, 2006 03:25 PM UTC
Thanks.
>Hi Hui,
>
>By checking HasCurrentCellAt(e.RowIndex, e.ColIndex) and HasReadOnly other requirements are fulfilled.
>
>
> if (e.RowIndex > gridControl1.Model.Rows.HeaderCount && e.ColIndex > gridControl1.Model.Cols.HeaderCount )
> if(this.gridControl1.CurrentCell.HasCurrentCellAt(e.RowIndex))
> {
> e.Style.Interior = new BrushInfo(Color.LemonChiffon);
> }
> if(this.gridControl1.CurrentCell.HasCurrentCellAt(e.RowIndex, e.ColIndex))
> {
> e.Style.Interior = new BrushInfo(Color.Yellow);
> }
> if( e.Style.HasReadOnly)
> {
> e.Style.Interior = new BrushInfo(Color.White);
> }
>
>
>Best regards,
>Stanley