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.
Your answer lead me to another solution that I think is better, since I was using the QueryCellInfo event anyway: if (e.ColIndex == -1) // row style needed { if (e.RowIndex % 2 == 1) //odd row { e.Style.BackColor = myOddRowColor; } }
I like more this method because I have to set the style once per row and not once for each cell. Or is it not so?
HAhaneefm Syncfusion Team July 13, 2007 11:18 PM UTC
Hi Lucia,
The QueryCellInfo is hit anytime the grid needs a cell style for any reason. So QueryCellInfo is hit prior to PrepareViewStyleInfo, and may be hit for other reasons than preparing the style for drawing. If you use code like grid[row, col], then QueryCellInfo is hit, but PrepareViewStyleInfo may not hit. So, if you are setting a style property that may be of use to you for something other than be drawn a certain way, then you should use QueryCellInfo to set the property dynamically.