Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DblClick in the Grid
Message
De
22/06/2000 14:18:54
 
 
À
22/06/2000 13:49:22
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00382904
Message ID:
00383348
Vues:
21
>I guess there's a little misunderstanding - thats my fault, so i'll try to make it as clear as possible.
>
>1. I subclass a grid. By default it does not have any columns, textboxes, etc. Just plain grid container.
>
>2. I add my grid class (GC) to the form. When I need my GC to show a different table, I'd set its RecordSource to that table and refresh the grid.
>
>3. After refresh, all the columns and controls inside the grid are created by default field mappings, without my intervention. The only thing I do programmatically is DeleteColumns (all of 'em) before changing RecordSource.
>
>4. How do I change field mappings for my grid class from default VFP textbox to subclassed textbox without adding any columns to the grid class (keeping ColumnCount = 0)? Is this possible?
>
>

You can't. What you'll have to do is change your column count and then spin through the columns adding your textbox class to the column. Change the column.CurrentControl property to be your new object's name, and optionally remove the old textbox class.


>
>>No, you can add textboxes or other controls of any class using the visual designer. Just make sure the grid is in edit mode, select the control you want from the Form Controls toolbar, and drop it in the column you want. If you want to delete the textbox that's already there, just select it in the drop down list on the property sheet, click on the grid's header, and press Del.
>>
>>But you say that you're creating everything on-the-fly anyway, which implies you're doing it programmatically. As you've already pointed out, you can't add code to a method programmatically, so it seems having a class with this code already in it is the way to go.
>>
>>>That means I have to create all the controls inside the grid programmatically, including columns, textboxes, checkboxes or whatever else might be mapped to the fields. Also I would have to subclass every possible type of control that could appear in the grid - and all that just for returning DblCLick?
>>>This grid is supposed to host *any* table, so columns and textboxes and headers are deleted and created on the fly by the grid itself when RecordSource is changed. WriteMethod does not work at run time so I have no way to put "this.Parent.Parent.DblClick" to my controls' DblClick method...
>>>;-(
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform