LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

ActiveX Grid Tutorial?

Our UI requires the user to enter up to 50 frequencies with each frequency three calculations are performed. My first thought was the Table control set up as 4 columns x 50 rows. However, the calculations cannot be edited only the frequencies. This ruled the Table out. I saw another post suggesting dual tables, but the problem of scrolling each eliminated that one. I then thought of the MS Flex/Data Grid, but can't seem to get any of the methods or properties working. Does anyone have an example of using these - especially with disabling cells?
0 Kudos
Message 1 of 12
(3,668 Views)
To back up a step for the moment, when you say you used an approach utilizing two tables, I assume you mean using one to hold the editable values and one to hold the non-editable values. Yes?I have used this approach many times and it isn't really very hard to do. What were the problems you were having?Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 2 of 12
(3,668 Views)
dprice wrote:
> Our UI requires the user to enter up to 50 frequencies with each
> frequency three calculations are performed. My first thought was the
> Table control set up as 4 columns x 50 rows. However, the
> calculations cannot be edited only the frequencies. This ruled the
> Table out. I saw another post suggesting dual tables, but the problem
> of scrolling each eliminated that one. I then thought of the MS
> Flex/Data Grid, but can't seem to get any of the methods or properties
> working. Does anyone have an example of using these - especially with
> disabling cells?

Just thought another possibility would be to place a transparent box
decoration over the table cells you want to disable; could work if no
horizontal scrolling is required.

Regards,
w
estscape.
0 Kudos
Message 3 of 12
(3,667 Views)
Out application is installed on a low resolution instrument (640x480), so I don't really know how easy it would be to synch both tables as you scroll down. If the user wanted to look at the results for 39th frequency, then he would have to scroll down the first table and then scroll down the second table. It seems a little messy. Do you have any suggestions?
0 Kudos
Message 4 of 12
(3,667 Views)
I have not used this technique before. Do you have a simple example that I could download? Also, what happens when the user uses keyboard navigation? Can the user still navigate to those fields that I'm trying to restrict?
0 Kudos
Message 5 of 12
(3,667 Views)
dprice wrote:
> I have not used this technique before. Do you have a simple example
> that I could download? Also, what happens when the user uses keyboard
> navigation? Can the user still navigate to those fields that I'm
> trying to restrict?
You are quite right that using a transparent box doesn't stop keyboard
navigation. A work around is to check the values of the edit position
property node and force it back to column 0 if the user has strayed
away; although not ideal this seemed to work in practice but it might
just be possible for the user to input a value if they were fast enough
on the keyboard.

I noticed that there is also an Index Values property node; if you tried
the 2 tables approach as Mike Porter suggested you could use
this to
automatically scroll the vertical position of the other table; maybe
this is what he was suggesting?

Regards,

westscape
0 Kudos
Message 6 of 12
(3,488 Views)
I think Mike has in mind adjusting the visible attributes of the the two tables (one a control and the other an indicator) and using property nodes to make sure the visible rows of the control match the visible rows of the indicator. That way, there's no need for the user to scroll twice.

I've attached an example for the three-calculation approach you're after.

They key ideas are:
- Don't show the horizontal scrollbars
- Only show one vertical scrollbar between the two tables
- Adjust the tables to overlap in a way that makes the two tables look like a single object

Hope this helps,
John Lum
National Instruments
0 Kudos
Message 7 of 12
(3,667 Views)
Yes, exactly. The only other thing you might try is that if you don't want the slide between the two tables, you can use a modified slide control. Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 8 of 12
(3,488 Views)
Thanks for the help, John! Especially on the weekend! However, I was unable to get your example to run. Everytime I download and run it, I get the following messages and then LabVIEW exits:

---------------------------
Segment with index out of range will be deleted from wire (7FF72548^+38E0).
---------------------------
Stretched and broke wire (7FF72548^+38E0).
---------------------------
Insane object at BDHP+3770 in "freq_calcs.vi": {id } (0x4): Wire Segment (WIRE)
---------------------------
Failure : "fpsane.cpp", line 283 LabVIEW version 6.1 For assistance in resolving this problem, please record the preceding information and navigate to www.ni.com/failure, or contact National Instruments.
---------------------------

Any
suggestions?
Thanks!
0 Kudos
Message 9 of 12
(3,667 Views)
Need to check your computer John, I opened the VI under 6.0.2 and got the same basic error messages. Apparently one of the wires got stretched badly out of bounds. Anyway you delete the bad wire and rerun it and all is well with the world.

In any case, John's code is a good example of exactly what I was talking about. I have posted a slightly modified version that fixes the bad wire issue and adds a couple simple enhancements:

1: The Row Header values automatically to track the number of input values you have entered.

2: The display only updates when the input values change. This produces flicker on some machines--and saves bandwidth by preventing repetative calculations.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 10 of 12
(3,667 Views)