Professional UI Solutions
Site Map   /  Register


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 » Row and column pointer from CExtGridCell object. Collapse All
Subject Author Date
Eric Aug 10, 2011 - 11:31 AM

How can I obtain a pointer to the CExtReportGridItem and CExtReportGridColumn from a CExtGridCell object?

Technical Support Aug 14, 2011 - 9:27 AM

You can add CExtReportGridItem* and CExtReportGridColumn* properties into your grid cell class and initialize them after a grid cell instantiated.

Technical Support Aug 11, 2011 - 4:56 AM

If you have LONG nColNo, LONG nRowNo coordinates of a data cell in a report grid, you can convert them into row/column handles/pointers:

LONG nColNo = . . .
LONG nRowNo = . . .
CExtReportGridWnd * pWndReportGrid = . . .
    ASSERT( 0 <= nColNo && nColNo < pWndReportGrid->ColumnCountGet() );
    ASSERT( 0 <= nRowNo && nRowNo < pWndReportGrid->RowCountGet() );
HTEEITEM hti = pWndReportGrid->ItemGetByVisibleRowNo( nRowNo );
    ASSERT( hti != NULL );
CExtReportGridItem * pRGI = (CExtReportGridItem *)hti;
CExtReportGridColumn * pRGC = STATIC_DOWNCAST( CExtReportGridColumn, pWndReportGrid->GridCellGetOuterAtTop(nColNo) );

Eric Aug 11, 2011 - 8:14 AM

No, I don’t have the nColNo and nRowNo. At least I don’t think I have them.

I have a cell that derives from CExtGridCell. Let’s call it CMyCell.

I want to override the Compare function:

int CMyCell::Compare(const CExtGridCell & other, DWORD dwStyleMask, DWORD dwStyleExMask) const

Is it possible to have the CExtReportGridItem and CExtReportGridColumn pointers for THIS cell inside the CMyCell::Compare function?

If I have these 2 pointers I can retrieve the data needed to do my custom compare.

An alternative solution would be to have a pointer to the CExtReportGridWnd for THIS cell inside the CMyCell::Compare function?

Is that possible?

Also, CExtReportGridWnd is extremely memory heavy so I’d like to avoid adding a back pointer to the gird inside the cell object.