I have a databound grid view to which I added a hyperlink field to from the Fields dialog on the first column.
For each row I want to run some SQL that will return a count of records and add it to the end of my hyperlink field text so this can be seen from the grid view without having to go into the page via the hyperlink.
Here is some test code I was trying to get working but this replaces my hyperlink field instead of adding to it (it seems to add correctly to the bound fields).
Code:
Protected Sub GridView1_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView1.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
e.Row.Cells(0).Text &= " (0)"
End If
End Sub
My other problem is, instead of hard coding "(0)" I need to pickup the EventID from the grid view to run my SQL that gives me my count but cant seem to get it possibly becaus it's visible property is set to false? I think using the code below I can only pickup post rendered columns.
Any help would be greatfully recieved!