09-24-2008 01:12 AM
Dear All,
Is there any way to make a particular column in a table as control and rest indicators?
I am creating a table where in 1 column i display the speed which is calculated by the program and in the next column the user wants to add the distance.
So, in the table i want the column representing Speed should act as an indicator and the Distance Column should behave as a Control as the user manually has to enter the distance.
how is this possible?
Thanks,
Ritesh
09-24-2008 04:47 AM
Ritesh,
I don't know of an easy way to do this, but I would think it's possible with a little tricky programming. Is there a reason you need both in the same table instead of two columns side by side, one being a control and the other an indicator? If it is just for the visual feature, then it would be possible to create a table indicator and then create a custom control made to look like an exact replica of one of the columns. You could then place the custom control over the top of the table so that it would appear that the custom control is part of the table, only it would be a control and the rest would be indicators. Or even easier, you could just place a control column and indicator column side by side and keep the data separate in the application. If you need it all in one table for programming reasons, then it will be tricky. You would probably need to do something like fire events and check for value updates based on mouse positions and all that. Unless someone has a better idea.
Cheers,
Clint
09-24-2008 05:12 AM
Hello ritesh024,
The attached vi is a small exemple of "Control column" and " Indicator column".
This Vi computes the hypothenuse of a triangle according to the big and small side lengths.
It is composed of a table where first column is small side, second bigside, and the third is hypothenuse calculation.
When the table changes, the hypothenuse is computed according to big and small side lengths.
The hypothenuse column could be considered as "indicator" as you cannot change the value without triggering a new computation
Hope this helps!
09-24-2008 06:08 AM
The way I've done it (attached) is to use the table as a control, but disable it whenever you click on the column that you want to be an indicator. The Event Structure does this; it also calculates the speeds whenever time or a distance is added/changed.
It would be cleaner to calculate speed only for the row that has changed, but that's for you.
jm
09-24-2008 06:59 AM
@AntonieP,
Thanks for your Help but i couldn't run your VI as it is made in LV 8.6 and i am using LV 8.5. I dont know abt the compatability issues, but it gave an error saying cannot run this VI as it is made in the higher version of LV.
Could you pls make it in LV 8.5 and repost it?
@jcarmody,
Thanks for your program. It works fine.
It would be cleaner to calculate speed only for the row that has changed, but that's for you.
In my case, time is an indicator. so, the value of speed will only change when the value of distance is changed. i.e only for the row(distance) that has changed.
09-24-2008 09:00 AM
09-25-2008 01:37 AM
09-25-2008 02:12 AM
ritesh024 wrote:
And what is the difference between Table and Multicolumn Listbox?
Read the LV Help for more details on them.
Table is a decorated 2D Str Arr. ML Box is of Numeric datatype, which you can choose to be a Scalar or an Array based no your requirement. Its Itemnames property will serve as the equivalent of a table [if only the ML Box datatype is an array], as far as the data is concerned.
09-25-2008 02:22 AM
ritesh024 wrote:Is there any way to make a particular column in a table as control and rest indicators?
Just place a Flat Box from the Decorations palette over the particular columns of the Table Control, which you want to behave like indicators, ans make that Flat Box to be transparent & group it(them) along with the Table Control.
Not a good soultion. No coding needed; but the presence of the Flat Box must be documented somewhere.
09-25-2008 06:27 AM
@ Parthabe,
the solution suggested by Eugen Graf works Perfect.
Did you see that?
No need of putting decorative buttons on the table, as this becomes a tedious task if the column is really big.
He gave a very neat and clean solution with hardly any bit of coding.
Only thing is I want the same thing to haapen in MC Listbox as the headers of MCL look really cool.
Otherwise, its not a big deal. With a bit of colouring, even Table's Headers can look awesome.
Thanks,
Ritesh