.. include:: headings.inc .. currentmodule:: dataview .. _dataview.DataViewItem: ========================================================================================================================================== |phoenix_title| **DataViewItem** ========================================================================================================================================== :ref:`dataview.DataViewItem` is a small opaque class that represents an item in a :ref:`dataview.DataViewCtrl` in a persistent way, i.e. independent of the position of the item in the control or changes to its contents. It must hold a unique ``ID`` of type `void` in its only field and can be converted to and from it. If the ``ID`` is ``None`` the :ref:`dataview.DataViewItem` is invalid and :meth:`DataViewItem.IsOk` will return ``False`` which used in many places in the API of :ref:`dataview.DataViewCtrl` to indicate that e.g. no item was found. An ``ID`` of ``None`` is also used to indicate the invisible root. Examples for this are :meth:`DataViewModel.GetParent` and :meth:`DataViewModel.GetChildren` . | |class_hierarchy| Inheritance Diagram ===================================== Inheritance diagram for class **DataViewItem** .. raw:: html

Inheritance diagram of DataViewItem

| |method_summary| Methods Summary ================================ ================================================================================ ================================================================================ :meth:`~DataViewItem.__init__` Constructor. :meth:`~DataViewItem.GetID` Returns the ``ID``. :meth:`~DataViewItem.IsOk` Returns ``True`` if the ``ID`` is not ``None``. ================================================================================ ================================================================================ | |property_summary| Properties Summary ===================================== ================================================================================ ================================================================================ :attr:`~DataViewItem.ID` See :meth:`~DataViewItem.GetID` ================================================================================ ================================================================================ | |api| Class API =============== .. class:: DataViewItem(object) DataViewItem is a small opaque class that represents an item in a DataViewCtrl in a persistent way, i.e. **Possible constructors**:: DataViewItem() DataViewItem(item) DataViewItem(id) .. method:: __init__(self, *args, **kw) Constructor. |overload| **Overloaded Implementations**: **~~~** **__init__** `(self)` **~~~** **__init__** `(self, item)` :param `item`: :type `item`: dataview.DataViewItem **~~~** **__init__** `(self, id)` :param `id`: **~~~** .. method:: GetID(self) Returns the ``ID``. .. method:: IsOk(self) Returns ``True`` if the ``ID`` is not ``None``. :rtype: `bool` .. attribute:: ID See :meth:`~DataViewItem.GetID`