I am instantiating a datagridview with code on a form. It works but there is no horizontal scroll bar to allow showing of the right side of the dgv. I can tab through the fields and show the right side that way. But there is no scroll bar. There is a vertical scroll bar, but no horizontal scroll bar.
The datagridview is created with the following:
Code:
ReportDataGridView = New DoubleBufferedDataGridView
ReportDataGridView.Name = "Stock Items Report"
ReportDataGridView.Left = 14
ReportDataGridView.Top = 90
ReportDataGridView.Height = 520
ReportDataGridView.Width = 956
ReportDataGridView.BorderStyle = BorderStyle.None
ReportDataGridView.RowsDefaultCellStyle.SelectionBackColor = Color.DarkKhaki
ReportDataGridView.RowsDefaultCellStyle.SelectionForeColor = Color.Black
ReportDataGridView.RowsDefaultCellStyle.BackColor = Color.LightYellow
ReportDataGridView.RowsDefaultCellStyle.Font = New Font("Microsoft Sans Serif", 12)
ReportDataGridView.AlternatingRowsDefaultCellStyle.BackColor = Color.PaleGoldenrod
ReportDataGridView.ColumnHeadersDefaultCellStyle.Font = New Font("Microsoft Sans Serif", 11)
ReportDataGridView.ColumnHeadersHeight = 28
ReportDataGridView.AllowUserToAddRows = False
ReportDataGridView.AllowUserToDeleteRows = False
ReportDataGridView.AllowUserToOrderColumns() = True
ReportDataGridView.ReadOnly = True
AddHandler ReportDataGridView.CellClick, AddressOf ReportDataGridView_CellClick
Controls.Add(ReportDataGridView)
I have tried adding
Code:
ReportDataGridView.ScrollBars = ScrollBars.Both
and
Code:
ReportDataGridView.ScrollBars = ScrollBars.Horizontal
but neither worked. Maybe a width property I'm missing? If somebody could let me know that would be great.