Ok. So what i am trying to do is
1. Get all cells that are under the third column
2. Get the cell values
3. If any of the cells contain the number "1" i want to change it to name "Free"
4. If any of the cells contain the number "2" i want to change it to name "Paid"
5. If any of the cells contain the number "3" i want to change it to name "Pending"
5. If any of the cells contain the number "4" i want to change it to name "Complete"
4. I want this to occur on all cells below the third column only
So far i think i have managed to get all the cell information put into a variable (i think). Below is the code (This code is me trying to just change one of the cells)
Dim a As Integer = 1
Dim a1 As String = "Free"
Dim cellValues As New List(Of Object)
For Each row As DataGridViewRow In DGStateInfo.Rows
cellValues.Add(row.Cells(2).Value)
Next
If cellValues.Contains(a) Then
cellValues.Contains(a1)
End If
If cellValues.Contains(a) Then
cellValues.Contains(a1)
End If
To be honest i'm not even sure if i'm going about this the right way. This is going on my second week of trying different code with no luck.
I do know that you can use the DataGridView1.Insert(0, "Free") command but the problem is that the data that is loading into the datgridview with have different data in different cells at every load of the program.
I have also tried this
Dim value As Integer
For Each row As DataGridViewRow In DataGridView1.DataSource
DataGridView1.Item(0, 1).Value = value
Next
If Value.text = 1 than
value = "free"
End If
And this
Dim cellValues As New List(Of Object)
For i = 0 To DataGridView1.Rows.Count - 1
cellValues.Add(DataGridView1(0, i).Value)
Next
Thanks in advanced for the help!