Jul 02, 2006 11:21 AM|crippsy|LINK
I am looking to store the value from the selected record in a GridView so that I can Navigate to a new page with this as a session variable.
I have tried many variations of the code (held in the master page) but get a variation of issue. The simplified version of the code below returns and issue that GridView1 is not declared. As you can see from the Sub my gridview is called Grid view1. If I
uncomment the Dim statement for Gridview1 and run the screen i get "Exception Details:
System.NullReferenceException: Object reference not set to an instance of an object"
Protected Sub GridView1_SelectedIndexChanged(ByVal sender
ByVal e As System.EventArgs)
NewText = GridView1.Cells(0)
I have also tried variations on what to put in place of the system.EventsArgs and replacing
"NewText = GridView1.Cells(0)"
"NewText = e.item.Cells(0)"
as I have seen e.item in other examples but the item does not seem to be a member of
System.EventArgs or the other variations I use (i.e
However DataGridItemEventArgs does allow e.items.Cells(0) but returns the error that it "
does not have the same signature as delegate 'Delegate Sub EventHandler(sender As Object, e As System.EventArgs) "
Any advice would be most greatfully recieved