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

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

Jump to Post

did you initialise the values of the grid?

Jump to Post

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 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.