Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Listbox in a grid
Message
 
À
20/08/1997 12:18:58
Vinod Parwani
United Creations L.L.C.
Ad-Dulayl, Jordanie
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00045849
Message ID:
00045891
Vues:
35
>>I have a listbox as the .CurrentControl in the second column of a grid. It's values would be dependent upon the values in the first column of the grid. I'm a little leary of populating this listbox with the .RowSource as an alias because that might create too many open cursors as the grid could have lots of rows. I've set up a small SQL query in the .Requery method of the listbox which sends the results to an array. So far so good except the only values displayed (in all listboxes) are the end results from the last record in the grid. I need a good way to populate the listbox which would be able to properly read the value in column 1 of the grid.
>>
>>If you're about to suggest a grid in a grid, well I've done that and have a major bug. I've posted the question here and no one answered. I've sent the problem off to M$ tech support and have not received an answer from there yet either. This has caused me to experiment with using the listbox in column 2 rather than anothe grid but I need the best way to populate it.
>>
>>Thanks,
>>Steve Despres
>
>Can you pls tell what prob. you faced in grid in a grid..
>
>There is a example of grid in a grid with Visual Maxframe examples..
>
>Have a look at that...
>
>Their web site is www.maxlink.com

Hi Vinod,

Here's the issue with grid in grid: Parent grid has two columns, a textbox (my custom one) in column 1 and a grid in column 2. The child grid has 1 column which contains a textbox (again, same custom one). The .Bound and .Sparse properties for ALL columns are .F. The .RecordSource for each grid is a view created in the .BeforeOpenTables method of the form. The views are indexed in the .Init method of the form. The child grid has the .ChildOrder, .Linkmaster and the .RelationalExpr properties filled. The .ChildOrder property is set in code after indexing. The .ControlSource for each textbox is also set in the .Init of the form. No .ControlSource is set for the columns although I have experimented with that and got the same results.

Here's the bug. Upon display of the form, the grid in grid displays perfectly.
The child grid is properly displaying the related items according to the value in column 1 of the parent grid. I have code in the .MouseDown method of the textbox in the child grid to allow a user to "select" it. When I click on the child grid (column 1, remember the only column), it typically will display a value from another "child grid". This usually occurs not while clicking items in the same child grid, but when you click on separate items from different child grids. I've removed the "selection code" in the .MouseDown method to make sure that this is not the problem and it still persists. When the mouse button is released, the correct value will redisplay. If one clicks and does not hold the mouse button down, the differing value will still flash with the correct value being displayed afterwards. I simply cannot have this incorrect value displayed at ANY time during this operation.

Steve Despres
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform