Hi,
Can someone tell me how to set the backcolor of a specific cell?
thank yoo
Thanks, it's working now!
Wouldn't it be easier to have something like: worksheet.rows(0).cells(0).CellFormat.BackColor = Color.Red?
Regards,
Wim
You can set the cell's CellFormat.FillPatternForegroundColor to the color if you want a sollid background in your cell. Otherwise, use both the FillPatternForegroundColor and the FillPatternBackgroundColor and set the FillPattern.
Why is this thread moved?
If I wanted to know how to set the backcolor of a cell in the ultragrid, I would have asked my question in that forum. I want to know how to set the backcolor of a cell when using the Excel library.
Also, you might want to take a look at the WinGrid Performance Guide. There is some discussion in the guide about how to do this most efficiently. :)
You can do that in a couple of ways. I'm assuming it as ultra wingrid. The best place is to put it in InitialiazeRow event. You can do this by setting the appearance property.
e.Row.Cells["Field"].Appearance.BackColor = Color.Blue
or if you want to highlight the error after user action, you can do the same in BeforeCellDeactivate event as like.,
grid.ActiveCell.Appearance.BackColor = Color.Blue
Hope this helps..