LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to grey perticular cells in array

Hello Guys,
  i have certain numbers. i tried by inserting Cluster then added array to fit in format.
  Then filled array with Numberic Indicator. 
   this was 2 dimentional array and i culd extend by drag and drop for more rows.
 
   Now i want to grey out certain Cells in the array rows . Is there a way to do that ?
 
example
   0 |    1 2 3 4 5
   0 |    1 2 3 4 Greyelement
           1 2 3 4 5
 
 In above example in 2nd row only 4 elements are present
 and whereas in 1st and 2nd row there are 5 elements.
 Is there any way to grey this element ?
 
i have Attached example vi.
 
0 Kudos
Message 1 of 9
(3,213 Views)
In short, the answer is: No.

You can't change the properties of individual elements of an array. If you need to change properites of individual items you need to use clusters.

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 9
(3,205 Views)

First i inserted Cluster then started to add Array in it.
Lets say,, if i have 25 rows of elements but with different length,
Should i keep adding 1-dimentional array for all 25 rows.

i thought let me create 2 dimentional array of equal length and
whenever i dont need any element just Gray that.

Is there any easier approach ?

0 Kudos
Message 3 of 9
(3,201 Views)
Well one thing you can do is rather than creating a cluster with mulitple 1D arrays in it, is create a cluster containing a single 1D array. Each element of the array in turn is a cluster containing a 1D array. This way you can add additional 1D arrays without modifying the data structure. See the attached picture...

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

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

For help with grief and grieving.
Message 4 of 9
(3,188 Views)
Are you using this as a control or as an indicator? (Do you just need to display variable length rows or do you also need to prevent the operator from entering data in some of the higher cells?)
 
You could just fill the extra elements with e.g. NaN and do some logic that they cannot be changed (or immediately revert back to NaN if you try). With code or even suing an xcontrol.
 
If it is just an indicator, you could format your data into a table and leave the missing elements blank.
Message 5 of 9
(3,180 Views)
i needed exactly as Picture shown by Mike,
but Mike how did you just disable perticular cells in row ?? 
Are the rows made up of separte Single Dimentional arrays ?
 
 
Thanks
Praveen
0 Kudos
Message 6 of 9
(3,135 Views)


@praveen2 wrote:
i needed exactly as Picture shown by Mike,
but Mike how did you just disable perticular cells in row ?? 
Are the rows made up of separte Single Dimentional arrays ?

As Mike said, place a 1D array of numbers inside a cluster, and make a 1D array of such clusters.

Of course if this is a control, the grey elements on the left are not "disabled" by any definition of the term, they are just outside the current size of the inner 1D array. Any user can just enter a number (even zero) there, thus growing the array accordingly and un-greying the element.

 

Message 7 of 9
(3,110 Views)

Altabenh,
i wish wht you told will work
i Tried with these steps,but doesn't work
1) Inserted Cluster.
2) Inside Cluster,added Array
3) Inside array added Numeric indicator so that i can put some numbers
4) Next,Right click on the above array and "added one more Dimention".
5) Now Drag array to have 5 rows and 5 columns

  In First Row i need all elements to be filled complete row.
  In Second Row, i need to fill all except last 2 elements in row
 
  Once i start 1st Row every Cell will be grey,and i culd do fill all
  but when i come to 2nd row, i should not fill anything in last 2 cells
 Once i fill the first element in 2nd row the entire row becomes NON-Grey . How to stop this ?

Attached SnapShot of tried VI .

 

0 Kudos
Message 8 of 9
(3,097 Views)

Please look closely at Mike picture again.

it is a cluster taht contains a 1-d array of clusters

each cluster contains a 1-d array.

Your attempt fails because 2d arrays must be rectangular (all rows have same number of collums)

Ben

Message Edited by Ben on 05-22-2007 03:19 PM

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 9 of 9
(3,078 Views)