On a web form, I have a grid bound to a list of business objects. The grid is not editable but it has two auto-generated buttons, Edit and Select. After clicking Select, I click Edit on the same row activates the code attached....
Private Sub GridViewRegistrants_RowEditing(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GridViewRegistrants.RowEditing
Session("PatientDetails") = GridViewRegistrants.SelectedRow.DataItem
But for some reason, debugging shows the value of DataItem to be nothing, even though SelectedRow is not. (Yeah, I know I need to fix localhost, I will get to that soon...)
What am I doing wrong? How do I get a reference to the underlying object? That is what I expected DataItem to provide.