want 2nd item in a DataGridView row to be visible.
the value sVar is returning valid string values from a c++ dll.
How do I get sVar to show up in the 2nd column of my grid (Columns(1).Name ="Name" ) whose setup function is listed below;
The rowvalue 'i' is showing up correctly but not the string value in the second column. thx. -greg
For i = 1To nRowsWithMe.DataGridView1.Rows
Call foo(i - 1, sVar)
.Add(i, sVar.ToString)
EndWith
Next i
PrivateSub SetupDataGridView()Me.Controls.Add(DataGridView1)DataGridView1.ColumnCount = 4
With DataGridView1.ColumnHeadersDefaultCellStyle.BackColor = Color.Navy
.ForeColor = Color.White
.Font =
New Font(DataGridView1.Font, FontStyle.Bold)EndWithWith DataGridView1.Name =
"AnalogGrid".Location =
New Point(8, 8).Size =
New Size(500, 250).AutoSizeRowsMode = _
DataGridViewAutoSizeRowsMode.DisplayedCellsExceptHeaders
.ColumnHeadersBorderStyle = DataGridViewHeaderBorderStyle.Single
.CellBorderStyle = DataGridViewCellBorderStyle.Single
.GridColor = Color.Black
.RowHeadersVisible =
False.Columns(0).Width = 25
.Columns(0).Name =
"".Columns(1).Width = 100
.Columns(1).Name =
"Name"' .Columns(1).CellType..Columns(2).Width = 25
.Columns(2).Name =
"On".Columns(3).Width = 100
.Columns(3).Name =
"Range".Columns(3).DefaultCellStyle.Font = _
New Font(Me.DataGridView1.DefaultCellStyle.Font, FontStyle.Italic).SelectionMode = DataGridViewSelectionMode.FullRowSelect
.MultiSelect =
False.Dock = DockStyle.Fill
EndWithEndSub
