K
Kevin S Gallagher
I am looking for advice/code to assist in determining which cells are
visible on a DGV. The code below works but wanted to see if there are better
methods or perhaps the code below has issues I have not thought about.
Thanks,
Kevin
Dim x As Integer = 0
While x < dataGridView1.Rows.Count
Dim y As Integer = 0
While y < dataGridView1.Rows(x).Cells.Count
Dim c As DataGridViewCell = dataGridView1.Rows(x).Cells(y)
If c.Displayed Then
If Not c.Value Is DBNull.Value Or Nothing Then
Console.WriteLine("Row={0} Value={1}", x.ToString,
dataGridView1.Rows(x).Cells(0).Value)
End If
End If
System.Math.Min(System.Threading.Interlocked.Increment(y), y -
1)
End While
System.Math.Min(System.Threading.Interlocked.Increment(x), x - 1)
End While
visible on a DGV. The code below works but wanted to see if there are better
methods or perhaps the code below has issues I have not thought about.
Thanks,
Kevin
Dim x As Integer = 0
While x < dataGridView1.Rows.Count
Dim y As Integer = 0
While y < dataGridView1.Rows(x).Cells.Count
Dim c As DataGridViewCell = dataGridView1.Rows(x).Cells(y)
If c.Displayed Then
If Not c.Value Is DBNull.Value Or Nothing Then
Console.WriteLine("Row={0} Value={1}", x.ToString,
dataGridView1.Rows(x).Cells(0).Value)
End If
End If
System.Math.Min(System.Threading.Interlocked.Increment(y), y -
1)
End While
System.Math.Min(System.Threading.Interlocked.Increment(x), x - 1)
End While