06-13-2014 10:06 AM
Hi,
I have an array of clusters (pic in attachment) and i would like to know if its possible to change the background color (for example) of a single element without.
Regards,
Pedro
06-13-2014 10:13 AM
No
In an array of anything (cluster, strings, numbers) the back ground color is the same for all elements.
You can not change the color of just one element.
You can add a color box to your cluster and set it color different for each element.
Set the control to transparent and place the color box behind it.
06-13-2014 10:25 AM
06-13-2014 10:44 AM
Omar is pointing at an important point about arrays. With an array every element is seen as being logically identical to every other element. Consequently, the only thing that is (or can be) different from one value to the next is the value. That is why Omar's solution works: it depends on a changing value; and your original idea does not: it depends on a changing property.
However it's not just color. No property can be different between elements.
This all ties in when deciding what datatypes to use. Many people think the decision between array and cluster is simply a matter of the item (or element) datatypes. But its more of a matter of the logical meaning of the values. You could put the height, length, breadth and mass of a box in an array because all the numbers can be represented as floating-point values. But this would be incorrect because the values logically represent different things. In this case, the proper datastructure would be a cluster.
And this difference can have practical implications: like for instance if I need to extract the length I need to remember that it is element 2 -- or is it 1... See what I mean?
Mike...