Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Formatting DataGrid Column
Message
De
07/01/2004 08:27:27
 
 
À
07/01/2004 07:36:15
James Hansen
Canyon Country Consulting
Flagstaff, Arizona, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Divers
Thread ID:
00864572
Message ID:
00864585
Vues:
12
>I've been a developer for over 30 years, using FoxPro/Base for over 15, but there's a lot I don't yet know about .Net. I'm creating my first C# app, a port of a simple VFP app. Day 1 I'm cruising, but Day 2 I hit a problem with the DataGrid (mmDataGrid).
>
>I have fields stored in my only table as hundredths of a second, but the value can be hours. I would like to format the data as "hh:mm:ss.ss" in the DataGrid, but can't quite figure out how to do it. This was really simple in VFP. I just added my text box with a modified Refresh method to the grid and deleted the default textbox. That doesn't seem to be an option in C#.
>
>I read about the Format Event and have tried to set one up by finding the binding for the column text box using the DataBindings.GetEnumerator() method in the constructor after loading the data or in the load event, but GetEnumerator always returns no bindings.
>
>Can somebody please help put me on the right track here?
>
>...Jim Hansen
>Canyon Country Consulting

Jim,

If you convert your column to a Template Column, you can replace the controls within it with whatever you need. If you need details on how to do this, let me know.

Once you have the control(s) that you need in the column template(s), you can set the format string to display the data the way you need it. I don't know exactly what the format string should be in your particular case, but if you search the help files for "format strings", you should find what you need (or someone else here may already know). You can also define custom format providers if none of the default ones give you what you need.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform