Normal
0
false
false
false
MicrosoftInternetExplorer4
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-parent:"";
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin:0in;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:"Times New Roman";
mso-ansi-language:#0400;
mso-fareast-language:#0400;
mso-bidi-language:#0400;}
Now I have two problems with this
1. I get the name of the players but I can’t click on them to
go to Session.aspx page.
2. The reason that I’m using a HyperLinkColum is because I’m
passing other values and by changing my grid to this I’m not longer passing does values any more.
<asp:DataGrid ID="DataGrid1"
runat="server"
AutoGenerateColumns="false"
OnItemDataBound="DataGrid1_ItemDataBound">
<Columns>
<asp:BoundColumn DataField="Session" Visible="False"></asp:BoundColumn>
<asp:BoundColumn DataField="Players" Visible="False"></asp:BoundColumn>
<asp:TemplateColumn>
<itemtemplate>
<asp:HyperLink ID="gridHyperLink"
runat="server"><%#Eval("Player")%></asp:HyperLink>
</itemtemplate>
</asp:TemplateColumn>
</Columns>
</asp:DataGrid>
Protected Sub DataGrid1_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs)
If (e.Item.ItemType = ListItemType.AlternatingItem) OrElse (e.Item.ItemType = ListItemType.Item) Then
e.Item.Style.Add("cursor", "hand")
e.Item.Attributes.Add("onmouseover",
"defColor=this.style.backgroundColor;
this.style.backgroundColor='#BAE0F2';")
e.Item.Attributes.Add("onmouseout",
"this.style.backgroundColor=defColor;")
Dim gridHyperLink As
HyperLink = DirectCast(e.Item.FindControl("gridHyperLink"), HyperLink)
If gridHyperLink IsNot
Nothing Then
Dim eventHandler As String = "window.location.href='Session.aspx?games='
+ CookieValue();"
gridHyperLink.Attributes.Add("onclick",
eventHandler)
End If
End If
End Sub