.. wxPython Phoenix documentation

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

   Copyright: (c) 2011-2018 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.png" alt="Inheritance diagram of DataViewListStore" usemap="#dummy" class="inheritance"/></center>
   </div>
   <script type="text/javascript">toggleVisibilityOnLoad(document.getElementById('toggleBlock'))</script>
   <map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.RefCounter.html" title="wx.RefCounter" alt="" coords="76,5,187,35"/> <area shape="rect" id="node3" href="wx.dataview.DataViewModel.html" title="wx.dataview.DataViewModel" alt="" coords="33,83,231,112"/> <area shape="rect" id="node2" href="wx.dataview.DataViewListModel.html" title="wx.dataview.DataViewListModel" alt="" coords="21,160,243,189"/> <area shape="rect" id="node4" href="wx.dataview.DataViewIndexListModel.html" title="wx.dataview.DataViewIndexListModel" alt="" coords="5,237,259,267"/> <area shape="rect" id="node5" href="wx.dataview.DataViewListStore.html" title="wx.dataview.DataViewListStore" alt="" coords="23,315,241,344"/> </map> 
   </p>

|


|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.GetColumnCount`                            Overridden from :ref:`wx.dataview.DataViewModel`.
:meth:`~wx.dataview.DataViewListStore.GetColumnType`                             Overridden from :ref:`wx.dataview.DataViewModel`.
: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.ColumnCount`                               See :meth:`~wx.dataview.DataViewListStore.GetColumnCount`
:attr:`~wx.dataview.DataViewListStore.ItemCount`                                 See :meth:`~wx.dataview.DataViewListStore.GetItemCount`
================================================================================ ================================================================================


|


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


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

   **Possible constructors**::

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



   .. method:: __init__(self)

      Constructor.                   





   .. method:: AppendColumn(self, varianttype)

      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







   .. method:: AppendItem(self, values, data=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







   .. method:: DeleteAllItems(self)

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





   .. method:: DeleteItem(self, pos)

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


      :param `pos`: 







   .. method:: GetColumnCount(self)

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

      :rtype: `int`








   .. method:: GetColumnType(self, col)

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


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




      :rtype: `string`








   .. method:: GetItemCount(self)

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

                

      :rtype: `int`







      .. versionadded:: 2.9.4 
     








   .. method:: GetItemData(self, item)

      Returns the client data associated with the item.                  

                


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




      :rtype: :ref:`wx.UIntPtr`







      .. versionadded:: 2.9.4 
     







      .. seealso:: :meth:`SetItemData`   








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

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


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




      :rtype: `value`








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

      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







   .. method:: InsertItem(self, row, values, data=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







   .. method:: PrependColumn(self, varianttype)

      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







   .. method:: PrependItem(self, values, data=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







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

      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






      .. versionadded:: 2.9.4 
     







      .. seealso:: :meth:`GetItemData`   








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

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


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




      :rtype: `bool`








   .. attribute:: ColumnCount

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


   .. attribute:: ItemCount

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

