Hi,
You have to add a tablestyle to your grid. When filling for your
dataset specify a tablename that will be your mappingname. ie
DataAdapter.Fill(dataset, "MappingName")
Private Sub SetupGrid()
Dim ts As New DataGridTableStyle
ts.MappingName = "InvoiceData"
Dim colDescription As New DataGridTextBoxColumn
With colDescription
..MappingName = "Description"
..HeaderText = "Description"
..Width = 280
..NullText = ""
End With
Dim colQty As New DataGridTextBoxColumn
With colQty
..MappingName = "Quantity"
..HeaderText = "Qty"
..Width = 50
End With
Dim cm As CurrencyManager = CType(Me.BindingContext(dvClient),
CurrencyManager)
Dim pd As System.ComponentModel.PropertyDescriptor =
cm.GetItemProperties()("Each")
Dim colEach As New DataGridTextBoxColumn(pd, "C")
With colEach
..MappingName = "Each"
..HeaderText = "Each"
..Width = 50
End With
Dim colPrice As New DataGridTextBoxColumn(pd, "C")
With colPrice
..MappingName = "Price"
..HeaderText = "Price"
..Width = 50
End With
ts.GridColumnStyles.Add(colDescription)
ts.GridColumnStyles.Add(colQty)
ts.GridColumnStyles.Add(colEach)
ts.GridColumnStyles.Add(colPrice)
dgInvoiceData.TableStyles.Add(ts)
ts = Nothing
colPrice = Nothing
colEach = Nothing
colQty = Nothing
colDescription = Nothing
End Sub
Ken