W
Wizard
Hi All,
I have the following code (See below) why when I run my app dosn`t it format
the Datagrid as below, instead it just loads up the default Column styles
Many Thanks
Wizard
Private Sub frmSystemUsers_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Format DataTable
Dim aGridTableStyle As New DataGridTableStyle()
aGridTableStyle.MappingName = "SystemUsers"
Dim aUserName As New DataGridTextBoxColumn()
Dim aFirstName As New DataGridTextBoxColumn()
Dim aSurname As New DataGridTextBoxColumn()
With aUserName
..MappingName = "Users_Name"
..HeaderText = "UserName"
..Width = 30
End With
With aFirstName
..MappingName = "User_First"
..HeaderText = "First Name"
..Width = 65
End With
With aSurname
..MappingName = "User_Last"
..HeaderText = "Surname"
..Width = 50
End With
With aGridTableStyle.GridColumnStyles
..Add(aUserName)
..Add(aFirstName)
..Add(aSurname)
End With
dgdSystemUsers.TableStyles.Add(aGridTableStyle)
If dsSystemUsers.Tables(0).Rows.Count > 0 Then
With dgdSystemUsers
..DataSource = dsSystemUsers.Tables(0)
..Expand(-1)
..NavigateTo(0, "Users_Name")
End With
End If
End Sub
End Class
I have the following code (See below) why when I run my app dosn`t it format
the Datagrid as below, instead it just loads up the default Column styles
Many Thanks
Wizard
Private Sub frmSystemUsers_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Format DataTable
Dim aGridTableStyle As New DataGridTableStyle()
aGridTableStyle.MappingName = "SystemUsers"
Dim aUserName As New DataGridTextBoxColumn()
Dim aFirstName As New DataGridTextBoxColumn()
Dim aSurname As New DataGridTextBoxColumn()
With aUserName
..MappingName = "Users_Name"
..HeaderText = "UserName"
..Width = 30
End With
With aFirstName
..MappingName = "User_First"
..HeaderText = "First Name"
..Width = 65
End With
With aSurname
..MappingName = "User_Last"
..HeaderText = "Surname"
..Width = 50
End With
With aGridTableStyle.GridColumnStyles
..Add(aUserName)
..Add(aFirstName)
..Add(aSurname)
End With
dgdSystemUsers.TableStyles.Add(aGridTableStyle)
If dsSystemUsers.Tables(0).Rows.Count > 0 Then
With dgdSystemUsers
..DataSource = dsSystemUsers.Tables(0)
..Expand(-1)
..NavigateTo(0, "Users_Name")
End With
End If
End Sub
End Class