I have a grid which is contained in one of the tabs of a RadTabStrip/RadMultiPage setup. Each of the tabs causes an AJAX postback to dynamically load the contents upon first click of that tab. There is a grid on the first tab which is loaded when the page is displayed. The contents of the HyperLinkColumn disppear if I use the following code in the grid's ItemDataBound event:
When I comment out the code block it works fine, however. Any thoughts on why injecting an extra span into the HyperLinkColumn causes this behavior?
if (e.Item is GridDataItem) |
{ |
var item = e.Item as GridDataItem; |
var name = (HyperLink)item["Name"].Controls[0]; |
var extension = Path.GetExtension(name.Text).TrimStart('.'); |
var fileIcon = new HtmlGenericControl("span"); |
if (SiteMaster.FileIconCssClass.ContainsKey(extension)) |
{ |
fileIcon.Attributes.Add("class", "FileIcon " + SiteMaster.FileIconCssClass[extension]); |
} |
else |
{ |
fileIcon.Attributes.Add("class", "FileIcon FileIcon-Default"); |
} |
item["Name"].Controls.AddAt(0, fileIcon); |
} |
When I comment out the code block it works fine, however. Any thoughts on why injecting an extra span into the HyperLinkColumn causes this behavior?