How to create a grid:
class CDemoView : public CView
{
...
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void OnSize(UINT nType, int cx, int cy);
private:
Dapfor::GUI::CGrid m_Grid;
};
int CDemoView::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
...
m_Grid.Create(0, 0, WS_VISIBLE|WS_CHILD, CRect(), this, 1000);
Dapfor::GUI::CHeader* header = new Dapfor::GUI::CHeader(true);
header->Add(new Dapfor::GUI::CColumn(CDemoClass::FidPrice, _T("Field1"), 190));
m_Grid.SetHeader(header);
...
return 0;
}
void CDemoView::OnSize(UINT nType, int cx, int cy)
{
CMDIChildWnd::OnSize(nType, cx, cy);
CRect rc;
GetClientRect(rc);
m_Grid.MoveWindow(rc);
}
class CDemoClass : public Common::CDataObject
{
public:
enum
{
FidPrice,
};
...
double GetPrice() const;
...
};
CDemoClass* obj = new CDemoClass();
m_Grid.Add(obj);