N
Newbie!
Hi Group,
I`ve wrotesome code to format a datagrid with only the coloums I need.
However it won`t automatically open up my table format, It give me the
little + button, i click on that and its ok, how do i get it to
automatically open?
Ta
Si
I have the following code on my project:
Private Sub tbrMainMenu_ButtonClick(ByVal sender As System.Object, ByVal e
As System.Windows.Forms.ToolBarButtonClickEventArgs) Handles
tbrMainMenu.ButtonClick
Select Case True
Case e.Button Is Me.tbbPasswordLists
tpgExcellence.Visible = False
tpgPasswordLists.Visible = True
End Select
'Password Lists Table Mapping Start
Dim aGridTableStyle As New DataGridTableStyle()
aGridTableStyle.MappingName = "mapPasswordLists"
Dim aCol1 As New DataGridTextBoxColumn()
Dim aCol2 As New DataGridTextBoxColumn()
Dim aCol3 As New DataGridTextBoxColumn()
With aCol1
.MappingName = "System"
.HeaderText = "System"
.Width = 20
.Alignment = HorizontalAlignment.Left
.TextBox.Enabled = True
End With
With aCol2
.MappingName = "Username"
.HeaderText = "Username"
.Width = 110
.Alignment = HorizontalAlignment.Left
.TextBox.Enabled = False
End With
With aCol3
.MappingName = "WebAddress"
.HeaderText = "WebAddress"
.Width = 110
.Alignment = HorizontalAlignment.Left
.TextBox.Enabled = True
End With
With aGridTableStyle.GridColumnStyles
.Add(aCol1)
.Add(aCol2)
.Add(aCol3)
aGridTableStyle.MappingName = dsPasswordLists.Tables(0).TableName
End With
odaPasswordLists.Fill(dsPasswordLists)
dgdPasswordLists.TableStyles.Add(aGridTableStyle)
If dsPasswordLists.Tables(0).Rows.Count > 0 Then
With dgdPasswordLists
.DataSource = dsPasswordLists.Tables(0)
.Expand(-0)
.NavigateTo(0, "PasswordListMiscellaneous")
End With
End If
I`ve wrotesome code to format a datagrid with only the coloums I need.
However it won`t automatically open up my table format, It give me the
little + button, i click on that and its ok, how do i get it to
automatically open?
Ta
Si
I have the following code on my project:
Private Sub tbrMainMenu_ButtonClick(ByVal sender As System.Object, ByVal e
As System.Windows.Forms.ToolBarButtonClickEventArgs) Handles
tbrMainMenu.ButtonClick
Select Case True
Case e.Button Is Me.tbbPasswordLists
tpgExcellence.Visible = False
tpgPasswordLists.Visible = True
End Select
'Password Lists Table Mapping Start
Dim aGridTableStyle As New DataGridTableStyle()
aGridTableStyle.MappingName = "mapPasswordLists"
Dim aCol1 As New DataGridTextBoxColumn()
Dim aCol2 As New DataGridTextBoxColumn()
Dim aCol3 As New DataGridTextBoxColumn()
With aCol1
.MappingName = "System"
.HeaderText = "System"
.Width = 20
.Alignment = HorizontalAlignment.Left
.TextBox.Enabled = True
End With
With aCol2
.MappingName = "Username"
.HeaderText = "Username"
.Width = 110
.Alignment = HorizontalAlignment.Left
.TextBox.Enabled = False
End With
With aCol3
.MappingName = "WebAddress"
.HeaderText = "WebAddress"
.Width = 110
.Alignment = HorizontalAlignment.Left
.TextBox.Enabled = True
End With
With aGridTableStyle.GridColumnStyles
.Add(aCol1)
.Add(aCol2)
.Add(aCol3)
aGridTableStyle.MappingName = dsPasswordLists.Tables(0).TableName
End With
odaPasswordLists.Fill(dsPasswordLists)
dgdPasswordLists.TableStyles.Add(aGridTableStyle)
If dsPasswordLists.Tables(0).Rows.Count > 0 Then
With dgdPasswordLists
.DataSource = dsPasswordLists.Tables(0)
.Expand(-0)
.NavigateTo(0, "PasswordListMiscellaneous")
End With
End If