Below is a solution that should work.
note: Code is for an Infragistics UltraWebGrid control. The WebDataGrid control is the UltraWebGrid's successor.
C#:
protected void UltraWebGridCustomers_InitializeRow(object sender, Infragistics.WebUI.UltraWebGrid.RowEventArgs e)
{
TemplatedColumn col = (TemplatedColumn)e.Row.Cells.FromKey("HyperLinkEmailColumn").Column;
CellItem cellItem = (CellItem)col.CellItems(e.Row.Index);
HyperLink hyperLinkEmail = (HyperLink)cellItem.FindControl("HyperLinkSendEmail");
hyperLinkShowDetails.Attributes.Add("onclick", "alert('This is the email link');");
}
VB.NET:
Private Sub UltraWebGridCustomers_InitializeRow(ByVal sender As Object, ByVal e As Infragistics.WebUI.UltraWebGrid.RowEventArgs) Handles UltraWebGridCustomers.InitializeRow
Dim col As TemplatedColumn = CType(e.Row.Cells.FromKey("HyperLinkEmailColumn").Column, TemplatedColumn)
Dim cellItem As CellItem = CType(col.CellItems(e.Row.Index), CellItem)
Dim hyperLinkEmail As HyperLink = CType(cellItem.FindControl("HyperLinkSendEmail"), HyperLink)
hyperLinkShowDetails.Attributes.Add("onclick", "alert('This is the email link');")
End Sub
Aspx code:
<infragistics:UltraWebGrid ID="UltraWebGridCustomers" runat="server">
<Bands>
<infragistics:UltraGridBand BaseTableName="Customers" Key="BandCustomers">
<Columns>
...
<infragistics:UltraGridColumn Key="NameColumn" BaseColumnName="Name" IsBound="True">
<Header Caption="Name">
</Header>
</infragistics:UltraGridColumn>
<infragistics:UltraGridColumn Key="EmailColumn" BaseColumnName="Email" IsBound="True">
<Header Caption="Email Address">
</Header>
</infragistics:UltraGridColumn>
<infragistics:TemplatedColumn Key="HyperLinkEmailColumn">
<CellTemplate>
<asp:HyperLink ID="HyperLinkSendEmail" NavigateUrl='<%# "~/EmailForm.aspx?email=" & DataBinder.Eval(Container.DataItem,"Email")%>' ToolTip="Send Email" runat="server" />
</CellTemplate>
</infragistics:TemplatedColumn>
...
</Columns>
<AddNewRow View="NotSet" Visible="NotSet">
</AddNewRow>
</infragistics:UltraGridBand>
</Bands>
...
</infragistics:UltraWebGrid>