I had problem with this codes:
cell_0_value= dgv.CurrentRow.Cells[0].Value.ToString();
It says null at dgv.CurrentRow.Cells[0].Value but my table has 6 column and it already has value.
How do i get over it?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Since you are using
CurrentRowyou must have a cell selected first. Otherwise,CurrentRowreturns null.http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview.currentrow(v=vs.90).aspx