According to the documentation, the DrawCellBackground event should fire each time the background of a specified cell is drawn. How can I determine that specific cell that is being drawn in this event? When I look at the range object I do not get a specific cell but header cells. Please see attached example.
I modified the example with your suggestion (see attached), but not all cells are included. The listbox should have every cell that was drawn, but cell 2,2 (and others) are not included.
ADAdministrator Syncfusion Team January 17, 2005 09:33 AM
For optimization purposes, DrawCellBackGround is not raised unless you explicitly tell the grid that you want it rasied. To tell the grid to raise this event, you set the style.Interior property of desired cells to be the empty brushinfo, Syncfusion.Drawing.BrushInfo.Empty.
This will force the event to be raised for all cells.
this.gridControl1.TableStyle.Interior = Syncfusion.Drawing.BrushInfo.Empty;
ADAdministrator Syncfusion Team January 17, 2005 07:52 PM
Your suggestion works except for the fact that if I set the background color in queryCellInfo it does not fire.
I will change to not do this, but I am curious as to well setting the background color prevents the event from firing.
ADAdministrator Syncfusion Team January 18, 2005 12:45 AM
Setting style.BackColor changes style.Interior (it is really style.Interior that defines the cell''s backcolor as it specifies the brush used to draw it. The grid internally tracks changes in style.BackColor to set the BrushInfo assigned to style.Interior.)