>We need to display all the color/size variants of an inventory item in a grid. We could build a grid and use a grid column for every 'color', but the challenge is that the number of colors can vary from item to item. For instance, one inventory item may have 5 colors and 5 sizes associated with it, while another may have 6 colors and 4 sizes.
>
>Every time I retrieve the color/size variants for an inventory part I could end up with a cursor with a different number of columns; i.e. in one case the cursor may have 5 fields/columns for the 5 colors, while in the other case it will have 6 fields/columns for the 6 colors. This makes it difficult to use the IDE to design a gridview.
>
>Anyone know of any solutions or examples that deal with this?
Last time I did this, each item had a roster code attached to it, so I knew which scheme to display for it. This was about 15 years ago, in FP2.0... so you figure I just built a cursor and issued a browse on it.
Nowadays, the difference is that I'd probably do the same, just use an automatic grid (i.e. not pre-built, just a wide enough grid to accomodate the widest case) instead of browse... which browse would have done anyway. Then I'd, maybe, bindevent() certain events of the textboxes in each column to whatever it'd need to be. And set column headings to the colors... and disable column 1 which would contain the sizes (or vice versa).
I've done something similar recently, where I built a grid on-the-fly, which is also an option, but I had an easier case, when the number of columns would never be more than 4, so it was a bit easier to make it look nice. And I had the option of keeping this grid in a modal form which would show when needed, and there were no other controls on it (apart from the OK/Cancel buttons below), so I had the option to resize the form appropriately.