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 Tech Support » Show & Hide a cell Collapse All
Subject Author Date
Offer Har Apr 2, 2008 - 5:55 PM

Dear Support,


I would like to hide a cell, something like a normal control ShowWindow(..) function with SW_SHOW and SW_HIDE.


I don’t want to destroy the cell by calling GridCellSet(nCol,nRow,NULL) because then I lose the data in the cell, and have to do a lot of work fro maintaining the state.


Any ideas?


Thanks,


Ron.

Technical Support Apr 15, 2008 - 5:08 AM

We added support for invisible cells. You can turn on this feature by applying a new extended cell style __EGCS_EX_INVISIBLE to a cell whose content you would like to hide. Please request the updated code by email.

Technical Support Apr 8, 2008 - 12:56 PM

In this case you can override the CExtGridCell::OnPaintForeground() virtual method. Just don’t call the parent class’s method when the cell should be empty.

Offer Har Apr 8, 2008 - 12:59 PM

This is a problem. I have many type of cells, and I want a generic mechanism to show hide them - I cannot create derived to all cells types. Maybe tomorrow I will have a new cell type?


This should be built in into the base cell class, and accompanied by a style setting or ShowCell/HideCell function.


This is the same conceptual problem of disabling buttons in cells that I have reported before.

Technical Support Apr 10, 2008 - 10:46 AM

You can override GridCellGet()in a CExtGridWnd-derived class. Your method should invoke the parent class method to extract a CExtGridCell pointer from the grid’s data provider. Then your method should decide somehow whether to return this pointer or return NULL instead of what is assumed as a hidden grid cell. You can use some extended user defined grid cell style for marking grid cells of any type as hidden and using it in your GridCellGet() method.

Offer Har Apr 10, 2008 - 10:54 AM

This cannot work. I need the CExtGridCell for showing the cell back... This function is used for accessing the cell, not only for painting it.


I think there should be a style called __EGCS_HIDDEN or something like this, that when set, the cell should not be painted or accessible. Please consider adding this functionality - it seems to be a very powerful feature. What do you think?

Technical Support Apr 5, 2008 - 9:51 AM

All the grid cells support the undefined style. This style is widely used in the property grid control. Any grid cell with this style looks as it is empty. The property grid control applies this style to the grid cells representing combined property values which have different initial values. Just apply the __EGCS_EX_UNDEFINED_ROLE extended cell style and see if it what you are looking for. When you need to show cell’s content, just remove this style.


Offer Har Apr 5, 2008 - 10:11 AM

Dear Support,


As far as I know, the __EGCS_EX_UNDEFINED_ROLE does not clear the cell completely, but put it into in undefined state - for example in a color cell it will draw a ’?’ in the cell’s color square. I want the cell to be completely empty, and completly not-accessible, like a hidden control.