I have seen examples when to get datakey when you are using such
if typeof e.item is gridedititem and also e.item.isineditmode then
but I am only using the following in my itemdatabound to change add a datakey to a hyperlink)
if typeof e.item is gridedititem and also e.item.isineditmode then
but I am only using the following in my itemdatabound to change add a datakey to a hyperlink)
If TypeOf e.Item Is GridDataItem Then
Dim NonCrit As HyperLink = CType(e.Item.FindControl("hyNonCrit"), HyperLink)
Dim HyCrit As HyperLink = CType(e.Item.FindControl("hyCrit"), HyperLink)
Dim key As Integer = myRadGrid.SelectedItems(0).OwnerTableView.DataKeyValues("intPositionId")
If CInt(HyCrit.Text) > 0 Then
HyCrit.NavigateUrl = "TaskManage.aspx?Crit=" & key
e.Item.Cells(13).BackColor = Drawing.Color.Tomato
HyCrit.ForeColor = Drawing.Color.Tomato
End If
If CInt(NonCrit.Text) > 0 Then
NonCrit.NavigateUrl = "TaskManage.aspx?NCrit=" & key
End If
End If