By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,219 Members | 2,147 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,219 IT Pros & Developers. It's quick & easy.

help please or any coment please

P: n/a
hi friends,
I have a couple of questions.

I have a datagrid and a hyperlink column on it. all I want is when I click
the hyperlink, go to another page with the value which is in the second cell
of the row.
I tried this but it didnt work

Private Sub HL_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Handles DataGrid1.Unload
Session("info") =
DataGrid1.Items(DataGrid1.SelectedItem.ItemIndex). Cells(1).Text
End Sub
it gives me the error:
System.NullReferenceException: Object reference not set to an instance of an
object.

I assumed that I'm populating the grid after a postback and so the
selecteditem will be null. so I tried this:

If DataGrid1.Items(DataGrid1.SelectedItem.ItemIndex). Cells(1) Is
DBNull.Value Then
Session("info") = 0
Else
Session("info") =
DataGrid1.Items(DataGrid1.SelectedItem.ItemIndex). Cells(1).Text

End If
but it didnt work too..
how can I pass teh nullref error, is there a function like isnull in SQL?
am I all wrong? selecteditem.index for datagrid doesnt work this way?
AND How can I do what I want?

please help.....

Mar 26 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Pokemon,

I see a lot of code but I am curious how you do this.
I want is when I click
the hyperlink, go to another page with the value which is in the second
cell
of the row.


For that I see no code.

Cor
Mar 27 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.