The same C++ object can be inserted into the grid multiple times. Some rows related to the given object can be filtered or collapsed by parent items and some - cannot. Each time when you add a new object to the grid, the Dapfor::GUI::HITEM handle is returned. This handle stores object state, hierarchy position, children, etc. This handle doesn’t have to be visible. It means that the handle doesn’t need to have a row number.
There are many functions that can be used to locate C++ objects in the grid.
CTestClass* testClass;
Dapfor::GUI::HITEM handle = m_Grid.GetItem(testClass);
int row = m_Grid.GetRow(testClass);
Dapfor::GUI::ContextType context = m_Grid.GetContextType(testClass);
int row = m_Grid.GetRow(handle);
Dapfor::GUI::ContextType context = m_Grid.GetContextType(handle);
Dapfor::Common::CDataObject* testClass = m_Grid.GetDataObject(handle);
Dapfor::GUI::HITEM handle = m_Grid.GetItem(1);
Dapfor::GUI::HITEM handle = m_Grid1.GetItem(1, Dapfor::GUI::FixedContext);
Dapfor::Common::CDataObject* testClass = m_Grid.GetDataObject(1);
Dapfor::GUI::Handles children = m_Grid.GetChildren(handle, false);
Dapfor::GUI::Handles children = m_Grid.GetChildren(Dapfor::GUI::GI_SCROLLABLE_ROOT, true);
Dapfor::GUI::HITEM parent = m_Grid.GetParent(handle);
int level = m_Grid.GetHierarchicalLevel(hItem);
For more information about Implementation of IForEach interface read "IForEach interface" that can be very useful.