# wxDataViewEvent Class Reference
[Events, wxDataViewCtrl Related Classes]

`#include <wx/dataview.h>`

Inheritance diagram for wxDataViewEvent:
[legend]

## Detailed Description

This is the event class for the wxDataViewCtrl notifications.

## Events using this class

The following event handler macros redirect the events to member function handlers 'func' with prototypes like:

void handlerFuncName(wxDataViewEvent& event)
Event macros:

- EVT_DATAVIEW_SELECTION_CHANGED(id, func):
  Process a `wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED` event.
- EVT_DATAVIEW_ITEM_ACTIVATED(id, func):
  Process a `wxEVT_COMMAND_DATAVIEW_ITEM_ACTIVATED` event.
- EVT_DATAVIEW_ITEM_EDITING_STARTED(id, func):
  Process a `wxEVT_COMMAND_DATAVIEW_ITEM_EDITING_STARTED` event.
- EVT_DATAVIEW_ITEM_EDITING_DONE(id, func):
  Process a `wxEVT_COMMAND_DATAVIEW_ITEM_EDITING_DONE` event.
- EVT_DATAVIEW_ITEM_COLLAPSING(id, func):
  Process a `wxEVT_COMMAND_DATAVIEW_ITEM_COLLAPSING` event.
- EVT_DATAVIEW_ITEM_COLLAPSED(id, func):
  Process a `wxEVT_COMMAND_DATAVIEW_ITEM_COLLAPSED` event.
- EVT_DATAVIEW_ITEM_EXPANDING(id, func):
  Process a `wxEVT_COMMAND_DATAVIEW_ITEM_EXPANDING` event.
- EVT_DATAVIEW_ITEM_EXPANDED(id, func):
  Process a `wxEVT_COMMAND_DATAVIEW_ITEM_EXPANDED` event.
- EVT_DATAVIEW_ITEM_VALUE_CHANGED(id, func):
  Process a `wxEVT_COMMAND_DATAVIEW_ITEM_VALUE_CHANGED` event.
- EVT_DATAVIEW_ITEM_CONTEXT_MENU(id, func):
  Process a `wxEVT_COMMAND_DATAVIEW_ITEM_CONTEXT_MENU` event.
- EVT_DATAVIEW_COLUMN_HEADER_CLICK(id, func):
  Process a `wxEVT_COMMAND_DATAVIEW_COLUMN_HEADER_CLICKED` event.
- EVT_DATAVIEW_COLUMN_HEADER_RIGHT_CLICK(id, func):
  Process a `wxEVT_COMMAND_DATAVIEW_COLUMN_HEADER_RIGHT_CLICKED` event.
- EVT_DATAVIEW_COLUMN_SORTED(id, func):
  Process a `wxEVT_COMMAND_DATAVIEW_COLUMN_SORTED` event.
- EVT_DATAVIEW_COLUMN_REORDERED(id, func):
  Process a `wxEVT_COMMAND_DATAVIEW_COLUMN_REORDERED` event.
- EVT_DATAVIEW_ITEM_BEGIN_DRAG(id, func):
  Process a `wxEVT_COMMAND_DATAVIEW_ITEM_BEGIN_DRAG` event.
- EVT_DATAVIEW_ITEM_DROP_POSSIBLE(id, func):
  Process a `wxEVT_COMMAND_DATAVIEW_ITEM_DROP_POSSIBLE` event.
- EVT_DATAVIEW_ITEM_DROP(id, func):
  Process a `wxEVT_COMMAND_DATAVIEW_ITEM_DROP` event.
- EVT_DATAVIEW_CACHE_HINT(id, func):
  Process a `wxEVT_COMMAND_DATAVIEW_CACHE_HINT` event.

##

Library: wxAdvanced

Category: Events, wxDataViewCtrl Related Classes

## Public Member Functions
| wxDataViewEvent (wxEventType commandType=wxEVT_NULL, int winid=0)
| Constructor.
int | GetColumn () const
| Returns the position of the column in the control or -1 if no column field was set by the event emitter.
wxDataViewColumn * | GetDataViewColumn () const
| Returns a pointer to the wxDataViewColumn from which the event was emitted or NULL.
wxDataViewModel * | GetModel () const
| Returns the wxDataViewModel associated with the event.
wxPoint | GetPosition () const
| Returns the position of a context menu event in screen coordinates.
const wxVariant & | GetValue () const
| Returns a reference to a value.
void | SetColumn (int col)
| Sets the column index associated with this event.
void | SetDataViewColumn (wxDataViewColumn *col)
| For `wxEVT_DATAVIEW_COLUMN_HEADER_CLICKED` only.
void | SetModel (wxDataViewModel *model)
| Sets the dataview model associated with this event.
void | SetValue (const wxVariant &value)
| Sets the value associated with this event.
void | SetDataObject (wxDataObject *obj)
| Set wxDataObject for data transfer within a drag operation.
wxDataObject * | GetDataObject () const
| Used internally.
void | SetDataFormat (const wxDataFormat &format)
| Used internally.
wxDataFormat | GetDataFormat () const
| Gets the wxDataFormat during a drop operation.
void | SetDataSize (size_t size)
| Used internally.
size_t | GetDataSize () const
| Gets the data size for a drop data transfer.
void | SetDataBuffer (void *buf)
| Used internally.
void * | GetDataBuffer () const
| Gets the data buffer for a drop data transfer.
int | GetCacheFrom () const
| Return the first row that will be displayed.
int | GetCacheTo () const
| Return the last row that will be displayed.

List of all members.

## Constructor & Destructor Documentation

wxDataViewEvent::wxDataViewEvent | ( | wxEventType | commandType = `wxEVT_NULL`,
|  | int | winid = `0` |
| ) |  |  |

Constructor.

Typically used by wxWidgets internals only.

## Member Function Documentation

int wxDataViewEvent::GetCacheFrom | ( |  | ) | const

Return the first row that will be displayed.

int wxDataViewEvent::GetCacheTo | ( |  | ) | const

Return the last row that will be displayed.

int wxDataViewEvent::GetColumn | ( |  | ) | const

Returns the position of the column in the control or -1 if no column field was set by the event emitter.

void* wxDataViewEvent::GetDataBuffer | ( |  | ) | const

Gets the data buffer for a drop data transfer.

wxDataFormat wxDataViewEvent::GetDataFormat | ( |  | ) | const

Gets the wxDataFormat during a drop operation.

wxDataObject* wxDataViewEvent::GetDataObject | ( |  | ) | const

Used internally.

Gets associated wxDataObject for data transfer within a drag operation.

size_t wxDataViewEvent::GetDataSize | ( |  | ) | const

Gets the data size for a drop data transfer.

wxDataViewColumn* wxDataViewEvent::GetDataViewColumn | ( |  | ) | const

Returns a pointer to the wxDataViewColumn from which the event was emitted or NULL.

wxDataViewModel* wxDataViewEvent::GetModel | ( |  | ) | const

Returns the wxDataViewModel associated with the event.

wxPoint wxDataViewEvent::GetPosition | ( |  | ) | const

Returns the position of a context menu event in screen coordinates.

const wxVariant& wxDataViewEvent::GetValue | ( |  | ) | const

Returns a reference to a value.

void wxDataViewEvent::SetColumn | ( | int | col | ) |

Sets the column index associated with this event.

void wxDataViewEvent::SetDataBuffer | ( | void * | buf | ) |

Used internally.

Sets the data buffer for a drop data transfer.

void wxDataViewEvent::SetDataFormat | ( | const wxDataFormat & | format | ) |

Used internally.

Sets the wxDataFormat during a drop operation.

void wxDataViewEvent::SetDataObject | ( | wxDataObject * | obj | ) |

Set wxDataObject for data transfer within a drag operation.

void wxDataViewEvent::SetDataSize | ( | size_t | size | ) |

Used internally.

Sets the data size for a drop data transfer.

void wxDataViewEvent::SetDataViewColumn | ( | wxDataViewColumn * | col | ) |

For `wxEVT_DATAVIEW_COLUMN_HEADER_CLICKED` only.

void wxDataViewEvent::SetModel | ( | wxDataViewModel * | model | ) |

Sets the dataview model associated with this event.

void wxDataViewEvent::SetValue | ( | const wxVariant & | value | ) |

Sets the value associated with this event.

|  | [ top ]