Here is some code snippets that show how I am trying to access a HyperLinkField in a GridView from the code page. I seem to be doing this wrong because the line in code behind where I try to get a handle on the control fails because the Controls collection is empty.
How should I be doing this? My goal is to DataBind a DataSet to the HyperLinkFields I have built (works) and then slip in some URLs into the HyperLinkFields to go with them (no work).
Thank you for your time,
<asp:GridView ID="GridView1" runat="server" CellPadding="4" AutoGenerateColumns=false
<asp:HyperLinkField DataTextField="Column1" />
protected void GridView1_OnRowDataBound(object sender, GridViewRowEventArgs e)
HyperLink link = (HyperLink)e.Row.Cells.Controls; //this is where I get an index out of bounds because teh collection is empty
link.Text = "test";