Dapfor home  

How do I freeze a row?

Because the fixed rows may have an hierarchical structure, they can not be determined only by their absolute number (they can be collapsed or filtered). So, the grid has two contexts: fixed and scrollable. The 'freezed' rows belong to the fixed context.

//How to 'freeze' rows, already inserted into the scrollable context.

//Get a handle of the first row from the scrollable context.
Dapfor::GUI::HITEM hItem = m_Grid.GetItem(0);

//Detach the item with all children from the scrollable context
//Note, that the states (selection, expansion, hierarchy, etc.) 
//of all detached items are kept.
m_Grid.Detach(hItem);

//Attach already detached items to the fixed context
m_Grid.Attach(hItem, Dapfor::GUI::GI_FIXED_ROOT);


//Another way to 'freeze' the row is to move it to the fixed context
m_Grid.MoveAfter(hItem, Dapfor::GUI::GI_FIXED_ROOT, Dapfor::GUI::GI_LAST);

Copyright Dapfor 2007-2009
Generated on Sat Jan 30 15:01:23 2010 for MFCGrid by doxygen 1.5.5