02-15-2016 09:14 AM
Hello,
I have a question about editing Tree Controls.
I have played around witht he properties and thus far have not figured it out. This is what I am trying to do:
I have a tree control with multiple columns.
The columns are basically: Name, Description, Value 1, Value 2
What I want to do is be able to select either Value 1 and Value 2 and edit them individually in each row.
I DO NOT want to be able to edit Name and Description.
What I have been able to do thus far is make the table editable, and whenever I get the active cell string no matter cell I click in always returns the value of the first column.
I got around this issue by making my value changes by calling a popup box and edit the values, but I would much rather simplify it by editing the tree.
I cannot provide my actual code but if it helps I can make a facsimile example...
Solved! Go to Solution.
02-15-2016 09:27 AM - edited 02-15-2016 09:28 AM
Here is a suggestion :
- turn of the cell editing on the tree
- when the user double clics on a cell, if the column index is 2 or 3 then set the edit position to the appropriate cell
see this : (in this example I'm not filtering the column index, but I'm sure you'll be able to add this feature)
We have two ears and one mouth so that we can listen twice as much as we speak.
Epictetus
02-15-2016 09:27 AM - edited 02-15-2016 09:30 AM
Can you attach the code you are working on?
I think you can create the behavior you want to have by using event-driven programming....
Norbert
EDIT: @TiTiou: Writing ActiveItemTag will throw an error when no item tag is present (note: "" is a valid tag!). So either the tree must hide all non-existant items or you have to implement proper error handling.
02-15-2016 09:43 AM
Here is an example, with the fix in place 🙂
I knew there was a way to do it but I was missing a key piece, which I see now.
Thank you.
02-15-2016 09:45 AM
@ Norbert_B :
error handling?
Never heard of that, what is it?
We have two ears and one mouth so that we can listen twice as much as we speak.
Epictetus
02-15-2016 09:47 AM
Cool!
Trees are great, but not always easy to use!
What does the Duci means in Veni Vidi Duci?
We have two ears and one mouth so that we can listen twice as much as we speak.
Epictetus
02-15-2016 09:50 AM
My undestanding is it means "I Came, I Saw, I Calculated"
02-15-2016 09:57 AM
@TiTou wrote:
@ Norbert_B :
error handling?
Never heard of that, what is it?
Sorry for me just picking up strange buzzwords.... don't know either
😉
02-15-2016 10:54 AM
One last question:
I can double click on a tree item to change the limit in column 2 and 3, as shown in my example.
But I also have a child item in the tree, with the expand and hide option.
When I double click on column indexes 2 and 3 the cell becomes editable but the child items are either expanded and hiddedn at the same time since the double click was used.
Is there a way to disable that? It's very annoying.