1

I have a treeview that displays my data from a sqlite database. Everything works fine so far, but now I want that the user can manipulate the data directly in the treeview and save it back to the database. But I cant find a way to do that.

The part that I not working for me is to make the cell editable directly within the tree!

I have shortened my code for this post to this:

import tkinter.ttk as ttk

self.tree = ttk.Treeview(master, height=10)
#Tree Config
self.tree["columns"] = ("One","Two","Three")
self.tree.column("One",width = 100)
self.tree.column("Two",width = 100)
self.tree.heading("One",text="One", anchor=W)
self.tree.heading("Two",text="Two", anchor=W)
#Bind Doubleclick to the Tree
self.tree.bind("<Double-1>", self.tree_selectItem) 
#Add the Tree to the grid
self.tree.grid(row=1,column=1,columnspan=4, rowspan=5, sticky=N+E+S, pady=0, padx=25)
K-Doe
  • 509
  • 8
  • 29
  • You should explain what step is not working, if this is about updating the database and commit, there is nothing to help in the code – PRMoureu May 08 '18 at 07:18
  • You are totally right, I edited my post. Tha part I am searching for is to make the cell editable directly in the tree, without any extra buttons etc. Like an input box just within the treeview. – K-Doe May 08 '18 at 07:21
  • Have you seen this question? [How to make ttk.Treeview's rows editable?](https://stackoverflow.com/q/18562123/7432) – Bryan Oakley May 08 '18 at 14:25

0 Answers0