MFC Grid manual

NM_GRIDITEM Struct Reference

Sent by the grid to notify its parent window about item updating. This notification is sent in form of WM_NOTIFY message. More...

#include <Dapfor/GUI/Notifications.h>

List of all members.


Public Attributes

NMHDR hdr
 NMHDR structure that contains information about this notification message.
Notifications::NotificationType type
 Notification type.
CGridgrid
 The grid that sends this notification.
UINT state
 Combination of GUI::Notifications::ItemState enumeration.
HITEM item
 Handle in the grid.
Common::CDataObjectpDO
 The data object, associated with a handle.
ContextType context
 The grid context to which a handle is related.
int row
 Index of a line in the context.

Detailed Description

Sent by the grid to notify its parent window about item updating. This notification is sent in form of WM_NOTIFY message.

Related events identifiers:

GUI::Notifications::AddItem
GUI::Notifications::RemoveItem
GUI::Notifications::MoveItem
GUI::Notifications::AttachItem
GUI::Notifications::DetachItem
GUI::Notifications::FocusChanged
GUI::Notifications::SelectionChanged
GUI::Notifications::ExpansionChanged
GUI::Notifications::FilterChanged
GUI::Notifications::VisibilityChanged
GUI::Notifications::UpdateItem

GUI::NM_GRIDITEM* lpNotif = (GUI::NM_GRIDITEM*) lParam;

 Example:

 //File TestDlg.h

 class CTestDlg : public CDialog
 {
   ...

 protected:
     afx_msg void OnAddItem(NMHDR* pNMHDR, LRESULT* pResult);

 private:
     GUI::CGrid m_Grid;

     DECLARE_MESSAGE_MAP()
 };


 //File TestDlg.cpp

 BEGIN_MESSAGE_MAP(CTestDlg, CDialog)
     ...
     ON_NOTIFY(GUI::Notifications::AddItem, IDC_GRID, OnAddItem)
     ...
 END_MESSAGE_MAP()


 void CTestDlg::OnAddItem(NMHDR* pNMHDR, LRESULT* pResult)
 {
 
     GUI::NM_GRIDITEM* pItem = (GUI::NM_GRIDITEM*)pNMHDR;
     
     //To do something...
 
     *pResult = 0;
 }