Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27554

VS 2010 String problem

$
0
0
Hello to all,

I am trying to copy all vaules from dgv1 to dgv2. I have try with, this code, and it works fine, but, the problem is that it copies only numbers, so no cell, can't be string (e.g. that column1 is all strings)...

Code:

        DataGridView2.Rows.Clear()
        Dim a As Integer
        For a = 0 To DataGridView1.Rows.Count - 1
            If DataGridView1.Rows(a).Cells("Column1").Value = True Then
                DataGridView2.Rows.Add(DataGridView1.Rows(a).Cells("Column1").Value, DataGridView1.Rows(a).Cells("Column2").Value, DataGridView1.Rows(a).Cells("Column3").Value)
            End If
        Next

Any idea, how to use strings in specific column... tnx in front

oh, another thing, which is strange, with code above DataGridView2 is acting weard, lines flashes :confused:

Viewing all articles
Browse latest Browse all 27554

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>