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 » Hidden columns/rows in grid Collapse All
Subject Author Date
Rado Manzela Jun 29, 2010 - 8:45 AM

I’d like to let the user to hide some columns he don’t need, but I have to be able to update all columns so that correct data is displayed when hidden columns are shown. I’ve tried to use ColumnHide(). The problem is that I cannot access hidden cells.
I’ve tried to use this approach (adapted for columns):
http://www.prof-uis.com/prof-uis/tech-support/support-forum/rowhide-is-missing-rowunhide-in-grid-control-64511.aspx
but it does not work, ColumnCountGet() still returns number of visible columns so it is not even possible to get cell when last column is hidden, GridCellGet() will check requested index against ColumnCountGet() and will fail.
Methods for getting hidden rows/columns would be very handy to make grid usable for dynamic data, where user can see filtered result, but program can update all data in grid.
Do you have some working solution for this please?

Technical Support Jun 29, 2010 - 11:03 AM

The row/column hiding feature in the CExtGridWnd control was designed as part of the grid filtering feature. You can hide columns using the CExtGridWnd::ColumnHide() method and column count become less. You can un-hide only all the columns using the CExtGridWnd::ColumnUnHideAll() method. This means you should invoke the CExtGridWnd::ColumnUnHideAll() method with the bRedraw parameter set to false, access all the grid cells, hide the previously hidden columns by invoking the CExtGridWnd::ColumnHide() method with the bRedraw parameter set to false. You can invoke grid’s OnSwInvalidate() method to redraw the grid finally.