Link to home
Start Free TrialLog in
Avatar of running32
running32

asked on

DataGridView not declared

I need to loop though my datagrid and change the backgound color.  I get datagridview not declared, how do I declare it?  Thanks

 If DataGridView.Rows(i).Cells("locuscount").Value = "0" Then
            DataGridView.Rows(i).Cells("Status").Style.BackColor() = Color.AliceBlue
        End If
Avatar of mytonytiger
mytonytiger

make sure you have a datagridview on the dorm, and that it is named datagridview

it's probably datagridview1
that's form, not dorm. :Þ
Avatar of running32

ASKER

How do I declare a datagridview?  Thanks
Dim dataGridView1 As New DataGridView
how do you link it to the datagrid?  Thanks
If dataGridView1.Rows(i).Cells("locuscount").Value = "0" Then
            dataGridView1.Rows(i).Cells("Status").Style.BackColor() = Color.AliceBlue
End If

---

It'd be better if we could see your code...
Yeah, my crystal ball isn't working so well today. ;-)

ASKER CERTIFIED SOLUTION
Avatar of mytonytiger
mytonytiger

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank you