Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Editable time field in a grid
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01426074
Message ID:
01426128
Vues:
47
>>>> What is the best way to have grid cell bound to a datetime field in a table, but be able to display/edit only the time portion of the field.
>>>
>>>You can use the column's control source to specify a display format for the field in question.
>>>
myGrid.TimeColumn.ControlSource = TTOC(myDTfield,2)
>>
>>It makes column read only. How do you propose to handle Edit part?

>
>It doesn't make the column read only, at least with my experience. That said, I did misread the OP as only dealing with display and not edit. The control source formatting affects the default textbox control for display when the cell isn't active.
>
>For editing, I'd go with Naomi's suggestion of a container or change the grid's underlying cursor to have a field with just the time portion so that way nothing special needs to be done at the grid level.

Hi Jon,

Adding any function to the controlsource automatically makes this column read-only. BTW, I misread the question too - I thought he only wanted to change the date, not the time. And display the date only.
If it's not broken, fix it until it is.


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

Click here to load this message in the networking platform