Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to display array in grid.
Message
De
19/04/1999 13:38:58
 
 
À
16/04/1999 16:52:45
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00208077
Message ID:
00209763
Vues:
24
Jason,


>>
>>I think Rosanna is trying to have the 2nd column of the grid tied to the 2nd dimension of the array (the column of the array), in accordance with the combo selection in the first column of the grid.
>>
>>
>>
>>>>Hi all experts, I have a grid for inputting data, there is a combo box in the first column.
>>>>
>>>>grid.column.combo.RowSourceType = 5-array
>>>>grid.column.combo.RowSource = gaTemp
>>>>
>>>>The array gaTemp is a 2-dimensional array. I wanna know how to display gaTemp(selected by combo,2) in the 2nd column of the grid? I've tried to change the column.ControlSource, but I'm fail to display anything. :-(
>>>>
>>>>Thanks in advance!!
>>>>
>>>>Rosanna
>>>
>>>
>>>Rosanna,
>>>
>>>Could you be a bit more specific about what you are trying to do ??? I'm a little unclear as to what you are trying to accomplish.
>>>
>>>Jason
>
>
>Okay ...
>
>My first suggestion would be to not use an array. There are a couple of reasons for my suggestion. Foremost among them is that a cursor is much easier to deal with than an array. I'm not against arrays, but for this purpose there is what seems to me anyway to be an easier way. The second reason is that using a cursor takes advantage of intrinsic VFox engine behavior. Using engine behavior where possible always makes application development easier, whereas duplicating engine behavior programatically always make the app harder to work with in the long run.
>
>We have a grid, we'll call him oGrid for the moment. oGrid is driven by a cursor called curGridData who has three columns;
>
>item_id (integer), descrip (character 30), & cat_id (integer)
>
>We also have a cursor called curCatTypes (Holds a list of valid category types) with the columns
>
>cat_desc (character 10) & cat_id (integer) (The order is important)
>
>Okay, we need to set the following properties on oGrid
>
>WITH oGrid
> .ROWSOURCETYPE = 2 (Alias)
> .ROWSOURCE = "curGridData"
>ENDWITH
>
>I tend to do this in the init of the grid, but that isn't the only place to make it work.
>
>Okay, now we need to add (in the design environment) a combo box to the third column of oGrid, and change the current control property to the combo box. In the combo, we need to set the following properties.
>
>WITH oGrid.Column3.cboCategory
> .ROWSOURCETYPE = 2 (Alias)
> .ROWSOURCE = "curCatTypes"
> .BOUNDCOLUMN = "curCatTypes.cat_id"
> .CONTROLSOURCE = "curGridData.cat_id"
>ENDWITH
>
>Except for a little tweaking, that's it. The properties can be set at design time provided the cursors will exist before the grid initializes.
>
>If there's anything else I can help with let me know.
>
>Jason


.BoundColumn takes on a numeric argument, not needed in this case, coz' RowSource is single field. Shouldn't RowSource read "curCatTypes.Cat_ID" ?
Kenneth.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform