Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS General Discussion » how can i give the color to paricular grid cell Collapse All
Subject Author Date
Gunasekaran Velu Aug 30, 2005 - 8:42 AM

 


hi folks


      i want to give the color to patricular grid cell or each row. how can i give that? plz help.


 


Thanks


Guna

Gunasekaran Velu Aug 31, 2005 - 7:59 AM

 


ya i got thnaks a lot


Guna

Gunasekaran Velu Aug 30, 2005 - 10:28 PM

 


hi


 


  there is no virtual method in CExtGridWnd::OnGridCellQueryBackColor() and therre is no OnQuerybackcolor method. can u suggest any other way to implement that. thanks for ur effort.


 


Guna

Gunasekaran Velu Aug 30, 2005 - 10:28 PM

 


hi


 


  there is no virtual method in CExtGridWnd::OnGridCellQueryBackColor() and therre is no OnQuerybackcolor method. can u suggest any other way to implement that. thanks for ur effort.


 


Guna

Technical Support Aug 31, 2005 - 6:56 AM

We are sorry for misleading you. In fact, these methods were added in Prof-UIS 2.42.

So, you need to override CExtGridCell::OnPaintBackground() to change the cell background. Please take a look at the CDemoColoredCell class in the SimpleGrids sample. It seems it’s exactly what you need. The instances of this cell class are created in the first column of the grid control under the Colors tab. The second and third columns of this grid control contain cells with check marks and combo boxes, which allows you to customize the text/background color of the CDemoColoredCell objects.

Technical Support Aug 30, 2005 - 1:10 PM

You need to override the CExtGridCell::OnQueryTextColor() and CExtGridCell::OnQueryBackColor() virtual methods in a CExtGridCell-derived class and return the desired COLORREF value for the text/background color.

You can also override the CExtGridWnd::OnGridCellQueryTextColor() and CExtGridWnd::OnGridCellQueryBackColor() virtual methods in a CExtGridWnd-derived class to change the text/background color.

Please note that in Prof-UIS 2.42 we added the TextColorSet()/TextColorGet() and BackColorSet()/BackColorGet() methods to the CExtGridCell class, which allows you to specify text and background colors for the grid cells in the normal, hovered and selected modes.