LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Edit Tree Control Question, specific cells

Solved!
Go to solution

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...

Veni Vidi Duci
0 Kudos
Message 1 of 9
(5,062 Views)
Solution
Accepted by topic author DB_IQ

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)

2016-02-15_162534.jpg


We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

Message 2 of 9
(5,053 Views)

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.

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 3 of 9
(5,051 Views)

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.

Veni Vidi Duci
0 Kudos
Message 4 of 9
(5,024 Views)

@ 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

Antoine Chalons

0 Kudos
Message 5 of 9
(5,020 Views)

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

Antoine Chalons

0 Kudos
Message 6 of 9
(5,017 Views)

My undestanding is it means "I Came, I Saw, I Calculated"

Veni Vidi Duci
0 Kudos
Message 7 of 9
(5,010 Views)

@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

 

 

 

😉

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 8 of 9
(5,002 Views)

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.

Veni Vidi Duci
0 Kudos
Message 9 of 9
(4,973 Views)