I want to add three columns to my Treeview and name them 'Varenavn','Antall','Best før'. I tried the following:
self.tree = ttk.Treeview (height = 10, columns = 3)
self.tree.grid (row = 4, column = 0, columnspan = 2)
self.tree.heading ('#0', text = 'Varenavn', anchor = W)
self.tree.heading ('#1', text = 'Antall', anchor = W)
self.tree.heading ('#2', text = 'Best før', anchor = W)
But I am getting:
_tkinter.TclError: Column #2 out of range.
If I change the last bit of code to:
self.tree.heading ('#1', text = 'Best før', anchor = W)
The code runs fine, but overwrites 'Antall' to 'Best før' in the second column.
Any ideas would be greatly appreciated!