#include <Dapfor/GUI/IForEach.h>
class RowsCounter : public Dapfor::GUI::IForEach
{
public:
int GetVisibleRows() const {return m_VisibleRows;}
int GetInvisibleRows() const {return m_InvisibleRows;}
virtual bool operator () (Dapfor::GUI::CGrid& grid, Dapfor::GUI::HITEM item, Dapfor::Common::CDataObject* pDO)
{
if(grid.IsVisible(item))
{
m_VisibleRows++;
}
else
{
m_InvisibleRows++;
}
return true;
}
private:
int m_VisibleRows;
int m_InvisibleRows;
};
RowsCounter functor1;
m_Grid.ForEach(functor1);
RowsCounter functor2;
m_Grid.ForEachVisible(functor2);
For more information see How to locate objects of C++ class in the grid? in "How to locate C++ objects in the grid"