hello ,
i am getting error on it , object refrence is not set to an instance of an object ,
my code is

  if (dgvBlockSites.Rows[j].Cells[1].Value.ToString() != "-1")
                    {
                    //-------------- some code here
                    }

i dont know what is wrong with it , i have 4 or 5 rows in my grid , it give above mentioned error .
do any one has any idea how to deal with it ?

Regards

Recommended Answers

All 5 Replies

May be you .Value property is null kindly check it in QuickWatch..

thanks for the reply bro , but i find nothing form your link about my prob .

Regards

yes there are values in grid .

Hi sorry for bother its just link of site here not solution define.solution is that who i define in my post that

May be your .Value property is null kindly check it in QuickWatch

and second thing is that are you using this code on CellValidating event of grid view?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.