I am having difficulty getting Tablestyles to work on a
datagrid. I have 2 datasets, 1 filled and the other not. The
first contains customer, stock and order history information
and has the Customers table tied to a datagrid, while the
second is to be kept empty to accept new order items and is
tied to another datagrid on the same form. The same code I
used for setting up the TableStyle for my Customers datagrid
is not working for the New Order Items datagrid. Please help
if at all possible.

'******* Customers Table Columns *******
Dim ts As New DataGridTableStyle()
ts.MappingName = "Customers"
Dim DefMap(2, 1) As String
DefMap(0, 0) = "Name"
DefMap(0, 1) = "Name"
DefMap(1, 0) = "Contract"
DefMap(1, 1) = "Contract"
DefMap(2, 0) = "Extension"
DefMap(2, 1) = "Extension"

Dim column As New DataGridTextBoxColumn()
Dim i As Short
For i = 0 To GetSetting("OSInv", "CustColumns", "Qty",
"2")
column = New DataGridTextBoxColumn()
column.MappingName = GetSetting("OSInv", "CustColumns",
"Map" & i, DefMap(i, 0))
column.HeaderText = GetSetting("OSInv", "CustColumns",
"Header" & i, DefMap(i, 1))
column.Width = CInt(GetSetting("OSInv", "CustColumns",
"Width" & i, "80"))
column.NullText = GetSetting("OSInv", "CustColumns",
"Null" & i, "")
ts.GridColumnStyles.Add(column)
Next
dgCustomers.TableStyles.Add(ts)

'******* Order Items Table Columns *******
ts = New DataGridTableStyle()
ts.MappingName = "CustOrder"
ReDim DefMap(4, 1)
DefMap(0, 0) = "SKU"
DefMap(0, 1) = "SKU"
DefMap(1, 0) = "Qty"
DefMap(1, 1) = "Qty"
DefMap(2, 0) = "Manufacturer"
DefMap(2, 1) = "Manufacturer"
DefMap(3, 0) = "Description"
DefMap(3, 1) = "Description"
DefMap(4, 0) = "Unit"
DefMap(4, 1) = "Unit"

For i = 0 To GetSetting("OSInv",
"CustOrderColumns", "Qty", "4")
column = New DataGridTextBoxColumn()
column.MappingName = GetSetting("OSInv",
"CustOrderColumns", "Map" & i, DefMap(i, 0))
column.HeaderText = GetSetting("OSInv",
"CustOrderColumns", "Header" & i, DefMap(i, 1))
column.Width = CInt(GetSetting("OSInv",
"CustOrderColumns", "Width" & i, "80"))
column.NullText = GetSetting("OSInv",
"CustOrderColumns", "Null" & i, "")
ts.GridColumnStyles.Add(column)
Next
Me.dgCustOrder.TableStyles.Add(ts)