what is the proper way to set a command of either AppednItem() or SetItemData() with dataviewlistctrl in order to display data

I am programming using dataviewlistctrl for the first time, (I have programmed severals with TextCtrl and Grid) I created a form using wxFormBuilder and import the form into my script.
When I tried to display the data using either AppendItem() or SetItemData(). I got an error in both case Since this is the first try, I don’t know what kind of information are required in both command. I appreciate somebody can show me the proper way to setup command and arguments. My environment is python 2.7, wxpython 3.0.2, wxFormBuilder 3.5.1 and Win 10

I have to stay using wxpython 3.0.2 for other application.

I attach the sources of form (sy0013sf.py) and script (sy0013q.py)

sy0013sf.py (3.32 KB)

sy0013q.py (2.16 KB)

By try and error, I found the proper setup.
I just changed the statement of self.dvlc.SetItemData( intRow, lstData ) to self.dvlc.AppendItem( lstData ).

I also changed the form a little, but I don’t think it caused the error.

Anyway, I will attach both sources in case somebody have the same question.

2018年7月28日土曜日 0時52分11秒 UTC+9 jaxo…@yahoo.co.jp:

sy0013tf.py (3.18 KB)

sy0013q.py (2.1 KB)

···

I am programming using dataviewlistctrl for the first time, (I have programmed severals with TextCtrl and Grid) I created a form using wxFormBuilder and import the form into my script.
When I tried to display the data using either AppendItem() or SetItemData(). I got an error in both case Since this is the first try, I don’t know what kind of information are required in both command. I appreciate somebody can show me the proper way to setup command and arguments. My environment is python 2.7, wxpython 3.0.2, wxFormBuilder 3.5.1 and Win 10

I have to stay using wxpython 3.0.2 for other application.

I attach the sources of form (sy0013sf.py) and script (sy0013q.py)

I am not an expert… but, from what I got from the docs, the setItemData is a data that is not displayed, so, in case you want extra data (an id for example) when you click the row, you can set it, and retrieve inside the click function with the getItemData.
So, these 2 methods are not interchangeable…

···

On Jul 28, 2018, at 5:22 PM, “jaxonnoby@yahoo.co.jp” jaxonnoby@yahoo.co.jp wrote:

By try and error, I found the proper setup.
I just changed the statement of self.dvlc.SetItemData( intRow, lstData ) to self.dvlc.AppendItem( lstData ).

I also changed the form a little, but I don’t think it caused the error.

Anyway, I will attach both sources in case somebody have the same question.

2018年7月28日土曜日 0時52分11秒 UTC+9 jaxo…@yahoo.co.jp:

I am programming using dataviewlistctrl for the first time, (I have programmed severals with TextCtrl and Grid) I created a form using wxFormBuilder and import the form into my script.
When I tried to display the data using either AppendItem() or SetItemData(). I got an error in both case Since this is the first try, I don’t know what kind of information are required in both command. I appreciate somebody can show me the proper way to setup command and arguments. My environment is python 2.7, wxpython 3.0.2, wxFormBuilder 3.5.1 and Win 10

I have to stay using wxpython 3.0.2 for other application.

I attach the sources of form (sy0013sf.py) and script (sy0013q.py)

You received this message because you are subscribed to the Google Groups “wxPython-users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

<sy0013tf.py>

<sy0013q.py>