I want to use de column of type "DownloadAttachment" and I create the folow code in de aspx file. But when I associate this code in de "OnCommand" (client) of radgrid my code in RadGrid1_ItemDataBound breaks.
function gridCommand(sender, args) {
if (args.get_commandName() == "DownloadAttachment") {
var manager = $find('<%= RadAjaxManager.GetCurrent(Page).ClientID %>');
manager.set_enableAJAX(false);
setTimeout(function() {
manager.set_enableAJAX(true);
}, 0);
}
}
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
{
if ((e.Item.ItemType == Telerik.Web.UI.GridItemType.Item) || (e.Item.ItemType == Telerik.Web.UI.GridItemType.AlternatingItem))
{
PackCRM.Entities.Documento _doc = (PackCRM.Entities.Documento)e.Item.DataItem;
if (_doc.DocumentoLido)
e.Item.Font.Bold = false;
else e.Item.Font.Bold = true;
string docID = _doc.ID.ToString();
string param = "docid=" + _doc.ID.ToString() + "&ext=" + _doc.Tipo.ToLower().Trim();
string url = "preview/checkfile.aspx?" + param;
ImageButton btnView = (ImageButton)e.Item.FindControl("btnView");
btnView.OnClientClick = String.Format("OpenDialog('" + url + "')");
}
}
Why its ocurrs?
Help?