Hi,
In my VB6 project I am using a datagrid control to show information retreived using an ADO control. Is there anyway that I can vary the colour on a row based on the information contained in that row? Any help would be gratefully accepted.
It's a lot easier using MSHFlexgrid. You need to add the component to your project. It's file is MSHFlxGd.ocx
It has individual control of text, forecolor and backcolor at the individual cell level, and it's all covered in VBHelp Let me know if this helps
________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first
'There are 10 kinds of people in the world: those who understand binary, and those who don't.'
pgk:
The question was:
>"Is there anyway that I can vary the colour on a row based on the information contained in that row?"
DataGrid1.BackColor changes the color for the whole grid.
>"You can even use the DB Grid control as it provides Cell level color setting. I believe the format there is:"
No it doesn't.
>DBGrid1.Cells(column,row).BackColor = vbBlue
No such method or property or not even close to it.
AOLBoy: To do this you will need to use the flex grid as johnwm has already mentioned. A DBGrid or DataGrid does not have this possibility. [/b][/i][/u]*******************************************************
General remarks:
If this post contains any suggestions for the use or distribution of code, components or files of any sort, it is still your responsibility to assure that you have the proper license and distribution rights to do so!
I also sometimes read things too fast[/b][/i][/u]*******************************************************
General remarks:
If this post contains any suggestions for the use or distribution of code, components or files of any sort, it is still your responsibility to assure that you have the proper license and distribution rights to do so!
Did this solve your problem? Let me know if this helps
________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first
'There are 10 kinds of people in the world: those who understand binary, and those who don't.'
johnwm, I already pointed the error out to pgk and pgk already responded to the mistake. It wasn't a question anymore of what grid is needed, in order to do the color thing.
Ili: Just color the visible rows. And do this when the grid scrolls or resizes. [/b][/i][/u]*******************************************************
General remarks:
If this post contains any suggestions for the use or distribution of code, components or files of any sort, it is still your responsibility to assure that you have the proper license and distribution rights to do so!
Thanks for all your assistance, I have managed to solve my problem using MSHFlexGrid. I am now in the process of changing my existing Datagrids to MSHFlexigrids.
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.