Hello all.
I wish to display my data in different colors in datagrid.
Let say I have data: Name, Age, Address. If age is more than 20 then display the record in blue color. Otherwise display it in red color.
Anyone please help on this. Thanks.
Use the Flexgrid rather than the Datagrid, then you can set individual cell backcolors. To change the background of a whole row for example:
fg1.Row = 2
For i = 0 To fg1.Cols - 1
fg1.Col = i
fg1.CellBackColor = vbGreen
Next i
will colour the whole of the third row green
________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first
'People who live in windowed environments shouldn't cast pointers.'
AFAIK you can't easily change individual backcolours in the Datagrid (but I stand to be corrected!)
________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first
'People who live in windowed environments shouldn't cast pointers.'
johnwm is correct.
The only thing you can change the color/fonts on is the that for all records/columns to be identical, or just the active cell (and the latter via API call).
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.