Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grid Dynamic Caption
Message
 
 
À
10/03/2006 11:00:15
Luis Navas
Independent Consultant
Auckland, Nouvelle Zélande
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP1
Network:
Windows 2000 Server
Database:
MS SQL Server
Divers
Thread ID:
01103071
Message ID:
01103135
Vues:
28
This message has been marked as a message which has helped to the initial question of the thread.
Hi Luis,

I was thinking a little bit more on the problem and I believe, that the information about which caption to show (logical field, caption itself, whatever) should be in the cursor that drives the grid. The column with grid doesn't need to be bound.

Have you checked the example I provided? The button's Click will cal grid's refresh method. However, we need to be able to determine what to display in the button based on the table's field. Otherwise all buttons will show the same caption.

>Thanks. This column it's not bound to data, and I need it that way, because it's a generic grid, that wil always have this column and Recordsource may be diferent each time. So I tried to put two buttons with different captions, and when the users click on I create a property on the form to know wich row was clicked, and then y tried to use DynamicCurrentControl calling a method on my form but is not working.
>
>This is the code of my method
>
>
>Local lcRow As String
>lnRow=This.MultiGrid1.ActiveRow
>lcRow="_"+Alltrim(Str(lnRow))
>If !PemStatus(This,lcRow,5)
>	Return "Button1"
>Else
>        Return "Button2"
>EndIf
>
>Thanks
>
>Luis
>
>
>>>First, thanks for your answer. I need that commandbutton changes it's caption depending if an property or objects exists.
>>>
>>>When someone click the button in the grid, I add an object to the parent container with the name of the row of the grid in wich the commandbutton was clicked, in that moment I want to change the caption of the button clicked, but only in that button not all the other that are in the column.
>>
>>There's only one row at a time - the others are just the images of when they were current. That means you don't have n buttons for n rows, there's only one button. If you change some of its properties based on anything not related to the current row, then it applies to all rows.
>>
>>So when you add the object to parent, make sure you write something into a field in the current row (fields not shown on grid are also OK), and use the content of that field to build the commandbutton's caption. If you have trouble doing this, you may need n different buttons in your column and set the proper one via DynamicCurrentControl. You may try with just one button, .column.sparse=.f. and commandbutton's .refresh setting the button's caption - it may work, haven't tried.
>>
>>Alternately, you could put an underlined label or read-only textbox instead of the button, and have them display the content of the field I mentioned.
>>
>>Not sure this is clear... but it also isn't easy :).
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform