Dapfor home  

How do I get all rows, displayed in the grid.

The row in the grid is a visible entity that has its index in the grid's context. Note, that indexes in both scrollable and fixed contexts are started from 0. i.e if there are some 'freezed' rows, the index of the first scrollable row will start anyway from 0.
//1. You can iterate all visible rows
for(int i = 0; i < m_Grid1.GetRowCount(Dapfor::GUI::ScrollableContext); ++i)
{
    Dapfor::GUI::HITEM handle = m_Grid.GetItem(i);
}

//2. Get all visible root items belonging to the scrollable context
Dapfor::GUI::Handles handles = m_Grid.GetChildren(Dapfor::GUI::GI_SCROLLABLE_ROOT, true);

3. You can use Dapfor::GUI::IForEach interface that is very useful to iterate items in the grid. See this example that explanes how this interface can be used.


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