|
-
Jan 30th, 2008, 11:44 AM
#1
Thread Starter
Member
[RESOLVED] Accessing Last Row of a DataGrid
I am trying to access a column on the last row of my data grid but I am getting the following error - System.NullReferenceException was unhandled
Message="Object reference not set to an instance of an object."
Below I have included my vb.net code
Count = Me.DataGridView1.Rows.Count
MsgBox("70 " + Me.DataGridView1.Rows(Me.DataGridView1.Rows.Count - 1)
MsgBox("71 " + Me.DataGridView1.Rows(19).Cells.Item(4).Value.ToString) <---- This is the line generating the exception.
Thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|