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 » Custom Grid InPlace Controls Collapse All
Subject Author Date
Krustys Donuts Jun 1, 2007 - 5:10 PM

Is there sample code for customizing CExtGridWnd inplace controls? We want an in-place progress bar.

Krustys Donuts Jun 4, 2007 - 1:18 PM

I loaded and built the ProfUIS_Controls sample, but I could find no Grid tab in the running app. A check of the source code confirms that not only is CExtGridCellProgress not being used by the ProfUIS_Controls sample, but there is no CExtGridWnd in the sample at all.

Nevertheless, I tried making a Grid Cell into a CExtGridCellProgress by the usual method:

CExtGridCellProgress *pCellProgress =
STATIC_DOWNCAST(
CExtGridCellProgress,
m_wndGrid.GridCellGet(
nColNo,
nRowNo,
0,
0,
RUNTIME_CLASS(CExtGridCellProgress)
)
);

... and this code ended up causing an Assertion failure in MFC code that implements the STATIC_DOWNCAST macro -- the Grid Cell object being returned wasn’t even of type CExtGridCellProgress !

We appear to be using Prof-UIS version 2.5.3.0, if that makes any difference.

Technical Support Jun 5, 2007 - 9:21 AM

Please take a look at the ProfUIS_Controls sample carefully. In the CPageGrid class there is a variable m_wndGrid, which represents a grid with class name CMyGridWnd. The progress cells are initialized in the CPageGrid::_InitColumnProgress() method.

The STATIC_DOWNCAST macro ASSERTs if the cell object returned by the GridCellGet method does not point to an object derived directly or indirectly from CExtGridCellProgress. In other words, the cell with coordinates specified by nColNo and nRowNo is already instantiated and has another type, not CExtGridCellProgress.

Technical Support Jun 2, 2007 - 6:48 AM

If you mean a progress bar in a cell, there is a ready-to-use class CExtGridCellProgress. You can see how it is used in the ProfUIS_Controls sample (select the Grid tab).