Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Strange Behavior Of DataGridView
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
Strange Behavior Of DataGridView
Versions des environnements
Environment:
VB 8.0
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01225269
Message ID:
01225269
Vues:
74
I am using a DGV Object, which I initially bind its DataSource to a DataTable. After binding, I run a "FormatGrid()" method which format the columns of the grid. One command I do is the following:
        If gridStudents.Columns.Contains("DOB") Then
            With gridStudents
                .Columns("DOB").HeaderText = "DOB"
                .Columns("DOB").Width = objGraphics.MeasureString("XX/XX/XXXX", objFont).Width + 15
                .Columns("DOB").DisplayIndex = 3
                .Columns("DOB").CellTemplate.Style.Format = "MM/dd/yyyy"
            End With
        End If
Now, the above code works perfectly...the first time. But later, if I reload the data in the DataTable, which I then unbind and rebind the DataSource and call the FormatGrid() method again, the "MM/dd/yyyy" format will not apply itself. It defaults to the mormal date display.

Anyone know what I am doing wrong or how to force the DGV to display the Date format as I want it to?
________________________
Ben Santiago, MCP & A+
Programmer Analyst (SQL, FoxPro, VB, VB.Net, Java, HTML, ASP, JSP, VBS)
Eastern Suffolk BOCES - Student Data Services


Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
-Rich Cook
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform