I picked up some code that is building a Gridview with a SQLDataAdapter.
One of the columns is an email address that I would like to make a hyper link to open Outlook (Users defautl email client).
The Gridview is all managed in code behind. Is there some way to do this?
Here is the code….
If counter > 0 Then
Dim command4 As New SqlCommand(queryString4, connection)
Dim mySQLDataAdapter4 As New SqlDataAdapter(command4)
mySQLDataAdapter4.Fill(emailDataset, "needsEmail")
End If
Next
connection.Close()
GridView4.DataSource = emailDataset
GridView4.DataBind()
There is code that checks that data is returned that I have removed for readability.
I return 4 columns in the query. Everything works great, just want to make one of the columns and active email link.
Thanks,
do this with a template field like so:
should render
Edit:
You don’t need all the columns to be template fields. The rest of the columns can simply be like this:
You didn’t post any of your gridview code so I’m guessing about something of this. If you are trying to get the email out of the gridview in the code behind you can look at this link. It describes hiding an ID field but you should be able to do the same with the raw email address.