Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Silly question
Message
De
28/03/2002 09:43:22
 
 
À
27/03/2002 11:31:50
Rex Mahel
Realm Software, Llc
Ohio, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Titre:
Divers
Thread ID:
00637902
Message ID:
00638416
Vues:
26
hello rex, here is a bit of code that should help. you can also assign the width in design mode by going to the properties of the datagrid and adding a tablestyle the collection and then by adding columns collections to the tablestyle. hope this helps.

Private Sub AddCustomDataStyle()
Dim Ts1 As New DataGridTableStyle()
Ts1.MappingName = "Employee"

Dim grdColStyleA As New DataGridTextBoxColumn()

grdColStyleA.Width = 0
grdColStyleA.MappingName = "EmployeeID"
grdColStyleA.HeaderText = "ID"
Ts1.GridColumnStyles.Add(grdColStyleA)

grdColStyleA = New DataGridTextBoxColumn()
grdColStyleA.Width = 152
grdColStyleA.MappingName = "strEmployeeName"
grdColStyleA.HeaderText = "Employee Name"
Ts1.GridColumnStyles.Add(grdColStyleA)

grdColStyleA = New DataGridTextBoxColumn()
grdColStyleA.Width = 75
grdColStyleA.MappingName = "strEmployeeNumber"
grdColStyleA.HeaderText = "Emp. Number"
Ts1.GridColumnStyles.Add(grdColStyleA)

grdColStyleA = New DataGridTextBoxColumn()
grdColStyleA.Width = 75
grdColStyleA.MappingName = "strEmployeeCode"
grdColStyleA.HeaderText = "Emp. Code"
Ts1.GridColumnStyles.Add(grdColStyleA)

grdColStyleA = New DataGridTextBoxColumn()
grdColStyleA.Width = 86
grdColStyleA.MappingName = "strEmployeePassword"
grdColStyleA.HeaderText = "Password"
Ts1.GridColumnStyles.Add(grdColStyleA)

Me.DataGrid1.TableStyles.Add(Ts1)
End Sub
Randy Belcher
AFG Industries, Inc.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform