I need to display some rows in CExtTreeGridWnd with the same background as outer cells. I’ve overrided OnGridHookCellPaintBackground(), but I need to get row’s HTREEITEM to assign correct background (as efficiently as possible). How can I do this?
I’ve tried this:
bool CChildView::OnGridHookCellPaintBackground(
const CExtGridCell & _cell,
CDC & dc,
LONG nVisibleColNo,
LONG nVisibleRowNo,
LONG nColNo,
LONG nRowNo,
INT nColType,
INT nRowType,
const RECT & rcCellExtra,
const RECT & rcCell,
const RECT & rcVisibleRange,
DWORD dwAreaFlags,
DWORD dwHelperPaintFlags
) const
{
const CExtTreeGridDataProvider &dp = GetTreeData();
const CExtTreeGridCellNode *_c = dp.TreeNodeGetByVisibleRowIndex(nRowNo);
but the last line asserts here in the very first call:
CExtTreeGridCellNode * CExtTreeGridDataProvider::_Tree_NodeGetByVisibleRowIndex( ULONG nRowNo )
{
ASSERT_VALID( this );
CExtGridDataProvider & _DP = _Tree_GetCacheDP();
nRowNo = _Tree_MapRowToCache( nRowNo );
CExtTreeGridCellNode * pNode =
STATIC_DOWNCAST(
CExtTreeGridCellNode,
_DP.CellGet( 0, nRowNo )
);
ASSERT_VALID( pNode ); // ASSERTS (pNode=NULL)
return pNode;
}
Is it bug, or am I doing something wrong? (I’m using 2.87)
Thank you