Home - Forums-.NET - FlyGrid.Net (Windows Forms) - Column filters and PaintCell

FlyGrid.Net (Windows Forms)

.NET Datagrid - Fast, highly customizable, industry standards .NET data grid control for WinForms

This forum related to following products: FlyGrid.Net

Column filters and PaintCell
Link Posted: 17-May-2006 11:54
I have a table in which the cells are color coded. To achive the color coding, I created a derived Column class and override its PaintCell method as follows.

        Public Overrides Sub PaintCell(ByVal dci As NineRays.Windows.Forms.Grids.CellDrawInfo)
            dci.customBackColor = GetBackColor(dci.row)
            MyBase.PaintCell(dci)
        End Sub


The table looks good. However, when I select the drop-down filter list for the column, the items in the list are also color coded, which is not the behavior that I want. I assume that the items in the drop-down list are also being drawn by my PaintCell method. Is there any way for me to tell whether PaintCell is being called to draw an item in the drop-down list or to draw the table cell?
Link Posted: 17-May-2006 12:15
You can examine dci.Text or dci.node.
If dci.Text != Null or dci.node == null - this is a draw item procedure in dropdown list, otherwise - normal drawing.
Link Posted: 18-May-2006 03:36
That worked like a charm.
Many thanks.