.. wxPython Phoenix documentation

   This file was generated by Phoenix's sphinx generator and associated
   tools, do not edit by hand.

   Copyright: (c) 2011-2020 by Total Control Software
   License:   wxWindows License

.. include:: headings.inc



.. _wx.dataview.DataViewListStore:

==========================================================================================================================================
|phoenix_title|  **wx.dataview.DataViewListStore**
==========================================================================================================================================

:ref:`wx.dataview.DataViewListStore`  is a specialised :ref:`wx.dataview.DataViewModel`  for storing a simple table of data. 
         

Since it derives from :ref:`wx.dataview.DataViewIndexListModel`  its data is be accessed by row (i.e. by index) instead of only by :ref:`wx.dataview.DataViewItem`. 

This class actually stores the values (therefore its name) and implements all virtual methods from the base classes so it can be used directly without having to derive any class from it, but it is mostly used from within :ref:`wx.dataview.DataViewListCtrl`. 









|

|class_hierarchy| Class Hierarchy
=================================

.. raw:: html

   <div id="toggleBlock" onclick="return toggleVisibility(this)" class="closed" style="cursor:pointer;">
   <img id="toggleBlock-trigger" src="_static/images/closed.png"/>
   Inheritance diagram for class <strong>DataViewListStore</strong>:
   </div>
   <div id="toggleBlock-summary" style="display:block;"></div>
   <div id="toggleBlock-content" style="display:none;">
   <p class="graphviz">
   <center><img src="_static/images/inheritance/wx.dataview.DataViewListStore_inheritance.svg" alt="Inheritance diagram of DataViewListStore" usemap="#dummy" class="inheritance"/></center>
   <script type="text/javascript">toggleVisibilityOnLoad(document.getElementById('toggleBlock'))</script>
   <map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.dataview.DataViewListStore.html" title="wx.dataview.DataViewListStore  is a specialised wx.dataview.DataViewModel  for storing a simple table of data." alt="" coords="28,313,280,341"/> <area shape="rect" id="node2" href="wx.dataview.DataViewIndexListModel.html" title="wx.dataview.DataViewIndexListModel  is a specialized data model which lets you address an item by its position (row) rather than its wx.dataview.DataViewItem  (which you can obtain from this class)." alt="" coords="5,236,302,265"/> <area shape="rect" id="node3" href="wx.dataview.DataViewListModel.html" title="Base class with abstract API for wx.dataview.DataViewIndexListModel  and wx.dataview.DataViewVirtualListModel." alt="" coords="25,159,283,188"/> <area shape="rect" id="node4" href="wx.dataview.DataViewModel.html" title="wx.dataview.DataViewModel  is the base class for all data model to be displayed by a wx.dataview.DataViewCtrl." alt="" coords="37,82,270,111"/> <area shape="rect" id="node5" href="wx.RefCounter.html" title="This class is used to manage reference-counting providing a simple interface and a counter." alt="" coords="86,5,221,34"/> </map> 
   </p>
   </div>

|


|method_summary| Methods Summary
================================

================================================================================ ================================================================================
:meth:`~wx.dataview.DataViewListStore.__init__`                                  Constructor.
:meth:`~wx.dataview.DataViewListStore.AppendColumn`                              Appends a data column.
:meth:`~wx.dataview.DataViewListStore.AppendItem`                                Appends an item (=row) and fills it with `values`.
:meth:`~wx.dataview.DataViewListStore.DeleteAllItems`                            Delete all item (=all rows) in the store.
:meth:`~wx.dataview.DataViewListStore.DeleteItem`                                Delete the item (=row) at position `pos`.
:meth:`~wx.dataview.DataViewListStore.GetItemCount`                              Returns the number of items (=rows) in the control.
:meth:`~wx.dataview.DataViewListStore.GetItemData`                               Returns the client data associated with the item.
:meth:`~wx.dataview.DataViewListStore.GetValueByRow`                             Overridden from :ref:`wx.dataview.DataViewIndexListModel`.
:meth:`~wx.dataview.DataViewListStore.InsertColumn`                              Inserts a data column before `pos`.
:meth:`~wx.dataview.DataViewListStore.InsertItem`                                Inserts an item (=row) and fills it with `values`.
:meth:`~wx.dataview.DataViewListStore.PrependColumn`                             Prepends a data column.
:meth:`~wx.dataview.DataViewListStore.PrependItem`                               Prepends an item (=row) and fills it with `values`.
:meth:`~wx.dataview.DataViewListStore.SetItemData`                               Sets the client data associated with the item.
:meth:`~wx.dataview.DataViewListStore.SetValueByRow`                             Overridden from :ref:`wx.dataview.DataViewIndexListModel`.
================================================================================ ================================================================================


|


|property_summary| Properties Summary
=====================================

================================================================================ ================================================================================
:attr:`~wx.dataview.DataViewListStore.ItemCount`                                 See :meth:`~wx.dataview.DataViewListStore.GetItemCount`
================================================================================ ================================================================================


|


|api| Class API
===============


.. class:: wx.dataview.DataViewListStore(DataViewIndexListModel)

   **Possible constructors**::

       DataViewListStore() -> None
       
   
   DataViewListStore is a specialised DataViewModel for storing a
   simple table of data.



   .. method:: __init__(self)

      Constructor. 
                 

      :rtype: `None`     








   .. method:: AppendColumn(self, varianttype : str)

      Appends a data column. 
                 

      `variantype`  indicates the type of values store in the column. 

      This does not automatically fill in any (default) values in rows which exist in the store already. 
                 


      :param `varianttype`: 
      :type `varianttype`: string




      :rtype: `None`     








   .. method:: AppendItem(self, values : VariantVector, data: Optional[UIntPtr]=None)

      Appends an item (=row) and fills it with `values`. 
                 

      The values must match the values specifies in the column in number and type. No (default) values are filled in automatically. 
                 


      :param `values`: 
      :type `values`: :class:`VariantVector`
      :param `data`: 
      :type `data`: wx.UIntPtr




      :rtype: `None`     








   .. method:: DeleteAllItems(self)

      Delete all item (=all rows) in the store. 
                 

      :rtype: `None`     








   .. method:: DeleteItem(self, pos : int)

      Delete the item (=row) at position `pos`. 
                 


      :param `pos`: 




      :rtype: `None`     








   .. method:: GetItemCount(self)

      Returns the number of items (=rows) in the control. 
                 


                

      :rtype: `int`







      .. versionadded:: 2.9.4 
     








   .. method:: GetItemData(self, item : DataViewItem)

      Returns the client data associated with the item. 
                 


                


      :param `item`: 
      :type `item`: wx.dataview.DataViewItem




      :rtype: `wx.UIntPtr`     







      .. versionadded:: 2.9.4 
     







      .. seealso:: :meth:`SetItemData`   








   .. method:: GetValueByRow(self, row : int, col : int)

      Overridden from :ref:`wx.dataview.DataViewIndexListModel`. 
                 


      :param `row`: 
      :type `row`: int
      :param `col`: 
      :type `col`: int




      :rtype: `DVCVariant`     








   .. method:: InsertColumn(self, pos : int, varianttype : str)

      Inserts a data column before `pos`. 
                 

      `variantype`  indicates the type of values store in the column. 

      This does not automatically fill in any (default) values in rows which exist in the store already. 
                 


      :param `pos`: 
      :type `pos`: int
      :param `varianttype`: 
      :type `varianttype`: string




      :rtype: `None`     








   .. method:: InsertItem(self, row : int, values : VariantVector, data: Optional[UIntPtr]=None)

      Inserts an item (=row) and fills it with `values`. 
                 

      The values must match the values specifies in the column in number and type. No (default) values are filled in automatically. 
                 


      :param `row`: 
      :type `row`: int
      :param `values`: 
      :type `values`: :class:`VariantVector`
      :param `data`: 
      :type `data`: wx.UIntPtr




      :rtype: `None`     








   .. method:: PrependColumn(self, varianttype : str)

      Prepends a data column. 
                 

      `variantype`  indicates the type of values store in the column. 

      This does not automatically fill in any (default) values in rows which exist in the store already. 
                 


      :param `varianttype`: 
      :type `varianttype`: string




      :rtype: `None`     








   .. method:: PrependItem(self, values : VariantVector, data: Optional[UIntPtr]=None)

      Prepends an item (=row) and fills it with `values`. 
                 

      The values must match the values specifies in the column in number and type. No (default) values are filled in automatically. 
                 


      :param `values`: 
      :type `values`: :class:`VariantVector`
      :param `data`: 
      :type `data`: wx.UIntPtr




      :rtype: `None`     








   .. method:: SetItemData(self, item : DataViewItem, data : UIntPtr)

      Sets the client data associated with the item. 
                 

      Notice that this class does `not`  take ownership of the passed in pointer and will not delete it. 


                


      :param `item`: 
      :type `item`: wx.dataview.DataViewItem
      :param `data`: 
      :type `data`: wx.UIntPtr




      :rtype: `None`     







      .. versionadded:: 2.9.4 
     







      .. seealso:: :meth:`GetItemData`   








   .. method:: SetValueByRow(self, value : DVCVariant, row : int, col : int)

      Overridden from :ref:`wx.dataview.DataViewIndexListModel`. 
                 


      :param `value`: 
      :type `value`: DVCVariant
      :param `row`: 
      :type `row`: int
      :param `col`: 
      :type `col`: int




      :rtype: `bool`








   .. attribute:: ItemCount

      See :meth:`~wx.dataview.DataViewListStore.GetItemCount`