Click here to Skip to main content
15,912,021 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
if (grdAddress.CurrentRow.Index <= -1)
           {
               return;
           }
           int Id = int.Parse(grdAddress.CurrentRow.Index.ToString());



in this code while edit, delete there is an error stating the following error message:

Object reference not set to an instance of an object.

Help will be highly appreciated.
Posted
Comments
Kenneth Haugland 8-Aug-12 7:13am    
Looks like you forgot to set a New on something.... Cant really tell, the code snipplet is too short :)

check that your grdAddress.CurrentRow not null
 
Share this answer
 
update it using datakey values if u have set any
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900