Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
The data grid is troubling me....
Message
From
08/03/2002 16:04:23
 
 
To
08/03/2002 15:15:17
Kishor K
KPIT Cummins Infosystems Ltd.
Pune, India
General information
Forum:
ASP.NET
Category:
Forms
Miscellaneous
Thread ID:
00630370
Message ID:
00630404
Views:
22
here is some code to customize grid columns. As far as adding checkboxes and comboboxes, I am not sure. I got a class off of gotdotnet to add a combobox, but it didn't seem to work right. The valuemember always showed up in the grid instead of the displaymember. I would like to see how it is supposed to work too. Anyway, below is the code to customize grid columns.
    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
Next
Reply
Map
View

Click here to load this message in the networking platform