I am using a Telerik Grid Control with a custom column that has a image button that has the item command attribute set to allow the row to be selected when the image is clicked.
The tool tip on the image button works great, but does not work great and throws an "unspecified error" when the image button is clicked before tooltip appears.
I have even commented out the code in the command:
protected void OnAjaxUpdate(object sender, ToolTipUpdateEventArgs args)
{
this.UpdateToolTip(args.Value, args.UpdatePanel);
}
private void UpdateToolTip(string ImagePath, UpdatePanel panel)
{
Control ctrl = Page.LoadControl("/ControlLibrary/FileUI/FilePopUp.ascx");
ControlLibrary.FileUI.
FilePopUp popUp = (ControlLibrary.FileUI.FilePopUp)ctrl;
popUp.theFileImagePath = ImagePath;
panel.ContentTemplateContainer.Controls.Add(popUp);
}
protected void FilesGrid_ItemCommand(object source, GridCommandEventArgs e)
{
//if (e.CommandName == "Select")
//{
// foreach (GridItem GI in FilesGrid.SelectedItems
// {
// GI.Selected = false;
// }
//}
}
protected
void FilesGrid_ItemDataBound(object sender, GridItemEventArgs e)
{
if (Session["UserID"] == null)
{
Response.Redirect("/default.aspx");
}
if (e.Item is GridDataItem)
{
GridDataItem item = (GridDataItem)e.Item;
//To access a cell Text
if (item["Cost"].Text == "$0.00")
{
item["Cost"].Text = "Free";
}
ImageButton theImg = (ImageButton)item["ThumbnailCol"].FindControl("thumbnailLnk");
Literal theNumBoards = (Literal)item["BoardsCol"].FindControl("NumBoards");
theNumBoards.Text = thumbnailsTA.CountNumBoards(
Convert.ToInt64(theImg.ImageUrl)).ToString();
RadToolTipManager1.TargetControls.Add(theImg.ClientID,
"/services/GetThumbnail.ashx?ID=1&height=200&width=200&FileID=" + theImg.ImageUrl, true);
theImg.ImageUrl =
"/services/GetThumbnail.ashx?ID=1&width=83&height=67&FileID=" + theImg.ImageUrl;
if (item["Type"].Text == "1")
{
item["Type"].Text = "yes";
}
else
{
item["Type"].Text = "no";
}
}
}
<telerik:RadToolTipManager OnAjaxUpdate="OnAjaxUpdate" ID="RadToolTipManager1"
runat="server"
Animation="Resize" Skin="Web20" Width="250px" Height="250px"
OffsetY="15" ShowDelay="2000"
AutoCloseDelay="4000" style="display: none;">
</telerik:RadToolTipManager>
Rick