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,
I have two cells within a row. I need to change the font colour dependant on their values i.e. if cell1 is less than cell2 then make it''s font colour red etc. Where is the best place to do this.
Thanks
ADAdministrator Syncfusion Team February 1, 2005 09:33 AM UTC
Try using PrepareViewStyleInfo. When e.RowIndex and e.ColIndex point to the cell you want to potentially color, compare e.Style.CellValue to your grid cell value (gotten by indexing; grid[e.RowIndex, someColIndex].CellValue). Then set e.Style.BackColor to the color based on teh result of the comparison.
IAIainFebruary 1, 2005 09:41 AM UTC
Hi,
Thanks for the super fast response. I have done this and it works well however I would like to change the font colour but can''t find the right property.
Many thanks
Iain
>Hi,
>
>I have two cells within a row. I need to change the font colour dependant on their values i.e. if cell1 is less than cell2 then make it''s font colour red etc. Where is the best place to do this.
>
>Thanks
ADAdministrator Syncfusion Team February 1, 2005 09:57 AM UTC
Try using e.Style.TextColor.
SUsukisj@suk.sas.comFebruary 1, 2005 10:03 AM UTC
Hi Clay,
I tried e.Style.BackColor and it works. When I try e.Style.TextColor it doesn''t.
Any ideas?
Thanks
Iain
ADAdministrator Syncfusion Team February 1, 2005 10:19 AM UTC
Instead of PrepareViewStyleInfo, use grid.QueryCellInfo (grid.Model.QueryCellInfo in a GridDataBoundgrid).
There are some properties that need to be set in QueryCellInfo instead of PrepareViewStyleInfo. The TextColor property could be used to initialize some type of edit control, and this would need to be set up early.