I have been Googling for a solution but I haven't found one. What I need to do is relatively simple I think. I am using a GridHyperLinkColumn. Sometimes the user will not have permission to view a particular link though.
So, in the code behind what I have at the moment is something like the code below. What I need to fill in is the what goes here ?????? bit. Is it possible to populate NavigateUrl with something that will make OnItemCommand fire in the normal way?
sender, GridItemEventArgs e)
var gridDataItem = e.Item
var entity = gridDataItem.DataItem
var url = GetLinkForEntitySomehow();
var link = (HyperLink)gridDataItem[
link.NavigateUrl = url;
what goes here ??????
My problem at the moment is that OnItemCommand will fire only if the cell is clicked somewhere outside the text of the anchor tag (because the anchor is being rendered without a link).Or is there a better way maybe. I hope I am making sense!