G
Guest
I have found an example of this in C# and converted the code the vb.net
however I am not getting the expected results. Here is my converted code:
cManager = CType(.BindingContext(InvItem), CurrencyManager)
dgInv.DataSource = InvItem
Dim myGridTableStyle As DataGridTableStyle = New
DataGridTableStyle
myGridTableStyle.MappingName = "InvItem"
Dim colInv As New DataGridTextBoxColumn
With colInv
.MappingName = "Inv"
.HeaderText = "Inv"
.Width = 5
End With
myGridTableStyle.GridColumnStyles.Add(colInv)
Dim colID As New DataGridTextBoxColumn
With colID
.MappingName = "ID"
.HeaderText = "ID"
.Width = 75
End With
myGridTableStyle.GridColumnStyles.Add(colID)
Dim colDue As New DataGridTextBoxColumn
With colDue
.MappingName = "Due"
.HeaderText = "Due"
.Width = 75
End With
myGridTableStyle.GridColumnStyles.Add(colDue)
dgInv.TableStyles.Clear()
dgInv.TableStyles.Add(myGridTableStyle)
Any ideals on what I am doing wrong?
however I am not getting the expected results. Here is my converted code:
cManager = CType(.BindingContext(InvItem), CurrencyManager)
dgInv.DataSource = InvItem
Dim myGridTableStyle As DataGridTableStyle = New
DataGridTableStyle
myGridTableStyle.MappingName = "InvItem"
Dim colInv As New DataGridTextBoxColumn
With colInv
.MappingName = "Inv"
.HeaderText = "Inv"
.Width = 5
End With
myGridTableStyle.GridColumnStyles.Add(colInv)
Dim colID As New DataGridTextBoxColumn
With colID
.MappingName = "ID"
.HeaderText = "ID"
.Width = 75
End With
myGridTableStyle.GridColumnStyles.Add(colID)
Dim colDue As New DataGridTextBoxColumn
With colDue
.MappingName = "Due"
.HeaderText = "Due"
.Width = 75
End With
myGridTableStyle.GridColumnStyles.Add(colDue)
dgInv.TableStyles.Clear()
dgInv.TableStyles.Add(myGridTableStyle)
Any ideals on what I am doing wrong?