Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Silly question
Message
From
28/03/2002 09:43:22
 
 
To
27/03/2002 11:31:50
Rex Mahel
Realm Software, Llc
Ohio, United States
General information
Forum:
ASP.NET
Category:
Forms
Title:
Miscellaneous
Thread ID:
00637902
Message ID:
00638416
Views:
27
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.
Previous
Reply
Map
View

Click here to load this message in the networking platform