Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Combobox + Grid - need some ideas
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00505121
Message ID:
00505298
Vues:
26
I think it is time to rethink your framework. < bg > First, you can create a local view on a free table. Second, your development life would become so much easier using views.

The problem with your idea of a read only column to display the description is that the same description will be displayed for every row. That description would be the description of the currently selected row of your lookup table. I am making the assumption that you are talking about making the control source of that description column the description field of the lookup table. That is why you need a view with a description field. There is a big difference when the ControlSource of a grid column is a field from the view which has different values for each record than there is when the controlsource is the currently selected record from a lookup table.

>Hi Mark,
>
>Thanks a lot for the idea. Unfortunately, this BldMstr table could be (not necessary) a free table. Besides, our framework was designed to work with tables, so I may have some problems, if I'll use a view.
>
>Perhaps, I should display just DeedType char 2 in a grid using combobox on the DeedType column (sparse will be .t., so only current column will show a combo) and I can add additional read-only column to display description. This idea is much simpler to implement.
>
>What do you think?
>
>Thanks again.
>
>>The only thing I can think of is to create an updatable view that also includes an extra field to hold the description of the DeedType. Whenever the Type is changed in the combo, use your InteractiveChange to replace the value in the description field to the current description.
>>
>>Leave both controls, Combobox1 and Text1, in that column. Set the ControlSource of your combo to the Code field. Set the ControlSource of Text1 to the Description field of the view. The CurrentControl should be set to Text1. The DynamicCurrentControl should be "Combobox1"
>>
>>>Hi everyone,
>>>
>>>I'll describe the whole situation so you can better understand my goal:
>>>I have a work table, aliased as BldMstr in an application. This BldMstr table has a field (Char 2) called DeedType. We also have a lookup table, called DeedType, which has Code (PK) and FullName (description).
>>>
>>>I want to show DeedType field in a grid. This is the only one editable field (all other columns will be Read-Only). I want to use ComboBox for the current record. For all other records I'd like to show description rather than code, but I don't want to set Sparse=.t. and use combobox. Another little problem - user should be able to select blank value (it's already in a DeedType table) and the description should show nothing (it now says in FullName field of DeedType table), and the field value in a BldMstr table should become .NULL. (I set nulldisplay to "").
>>>
>>>Could it be done, as I want? If so, could you please give me some advices (code samples)?
>>>
>>>Thanks in advance.
Mark McCasland
Midlothian, TX USA
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform