R
Rick
I'm adding columns to a datagridview in code. When I run the program the
data is bound correctly, but none of the column headers show.
Can someone point out what obvious mistake I am making?
Tnx,
Rick
Dim x As Integer
With dgvLookupPO
x = .Columns.Add("colPONum", "PO no")
..Columns(x).DataPropertyName = "PONum"
..Columns(x).ValueType = GetType(System.Int32)
..Columns(x).Visible = True
x = .Columns.Add("colPODate", "PO date")
..Columns(x).DataPropertyName = "PO_Date"
..Columns(x).ValueType = GetType(System.DateTime)
x = .Columns.Add("colPOTotal", "Total")
..Columns(x).DataPropertyName = "Total"
..Columns(x).ValueType = GetType(System.Decimal)
..Columns(x).DefaultCellStyle.Format = "###,###,##0.00"
..Columns(x).DefaultCellStyle.Alignment =
DataGridViewContentAlignment.MiddleRight
x = .Columns.Add("colPOVendor", "Vendor")
..Columns(x).DataPropertyName = "Name"
..Columns(x).ValueType = GetType(System.String)
End With
data is bound correctly, but none of the column headers show.
Can someone point out what obvious mistake I am making?
Tnx,
Rick
Dim x As Integer
With dgvLookupPO
x = .Columns.Add("colPONum", "PO no")
..Columns(x).DataPropertyName = "PONum"
..Columns(x).ValueType = GetType(System.Int32)
..Columns(x).Visible = True
x = .Columns.Add("colPODate", "PO date")
..Columns(x).DataPropertyName = "PO_Date"
..Columns(x).ValueType = GetType(System.DateTime)
x = .Columns.Add("colPOTotal", "Total")
..Columns(x).DataPropertyName = "Total"
..Columns(x).ValueType = GetType(System.Decimal)
..Columns(x).DefaultCellStyle.Format = "###,###,##0.00"
..Columns(x).DefaultCellStyle.Alignment =
DataGridViewContentAlignment.MiddleRight
x = .Columns.Add("colPOVendor", "Vendor")
..Columns(x).DataPropertyName = "Name"
..Columns(x).ValueType = GetType(System.String)
End With