This is a migrated thread and some comments may be shown as answers.

ToolTipManager Programmatically - OnAjaxUpdate

3 Answers 181 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
Nico
Top achievements
Rank 1
Nico asked on 21 Aug 2008, 10:20 AM
Hello,
we are trying to set up programmatically a tooltip manager on a RadGrid defined programmatically in a class inheriting Control. We associate both the RadGrid and the RadTooltipManager with the RadAjaxManager, and the generic item of the RadGrid is associated with a RadContextMenu with RightClick. The ContextMenu works, but we can't access programmatically to the OnAjaxUpdate event of the ToolTipManager (and we can't define the tooltipmanager on a ascx control, due to architectural design) because the compiler response is that the OnAjaxUpdate in not accessibile:

Error 7 'Telerik.Web.UI.RadToolTipManager.OnAjaxUpdate(Telerik.Web.UI.ToolTipUpdateEventArgs)' is inaccessible due to its protection level)

Could anyone help us?

Thanks a lot for the attention.

3 Answers, 1 is accepted

Sort by
0
Tsvetie
Telerik team
answered on 25 Aug 2008, 03:17 PM
Hi Nico,
I am not quite sure what you mean by saying "we can't access programmatically to the OnAjaxUpdate event". Do you mean that you cannot attach an AjaxUpdated handler dynamically? In case you could provide a simple project demonstrating the problem, that we can run without modifications, as well as detailed information on the expected result, we will do our best to help.

Sincerely yours,
Tsvetie
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Mic
Top achievements
Rank 1
answered on 01 Oct 2008, 03:30 AM
I got this code:
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Telerik.WebControls;
using Telerik.Web;
using System.Data.SqlClient;
using System.Collections;
using System.Collections.Generic;

namespace BlogUpdate
{
    public partial class IEyoutube : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void RadGrid1_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
        {

        }
        protected void RadGrid1_ItemCreated(object sender, Telerik.Web.UI.GridItemEventArgs e)
        {
            System.Web.UI.WebControls.Image image = (System.Web.UI.WebControls.Image)e.Item.FindControl("playLoad");
            DataRowView currentRow = (DataRowView)e.Item.DataItem;
            ////Add the image id to the tooltip manager
            this.RadToolTipManager1.TargetControls.Add(image.ClientID,"test", true);
           

        }
        protected void OnAjaxUpdate(object sender, Telerik.Web.UI.ToolTipUpdateEventArgs args)
        {
            this.UpdateToolTip(args.Value, args.UpdatePanel);

        }
        private void UpdateToolTip(string elementID, UpdatePanel panel)
        {
            String test = elementID;
            if (test == "")
                test = "None";
             Response.Write(test);
        }
    }
}

The test is "None" ... which supposes to be "test" ... why ??
0
Svetlina Anati
Telerik team
answered on 03 Oct 2008, 10:01 AM
Hi Mic,

I examined and tested your code and I am not quite sure what exactly happens in your application. When you use the RadToolTipManager and its OnAjaxUpdate event, you actually use an update panel and AJAX request. Therefore, you will receive an error when trying to use the Response.Write method and you should receive an alert with an error message and nothing to be outputted as a result.

Therefore, I tested your scenario by assigning the text to a label and then added it to the tooltip as shown below:

  private void UpdateToolTip(string elementID, UpdatePanel panel)  
        {  
            String test = elementID;  
            if (test == "")  
                test = "None";  
            Label lbl = new Label();  
            panel.ContentTemplateContainer.Controls.Add(lbl)   
        }  
 

After I did this, the label showed the expected and correct value - its text was "test". Would you please test your project with this modification and in case you still experience problems, please open a new support ticket and send me a sample, fully runnable project which could be examined without applying any modifications along with detailed reproduction steps. Once I receive it, i will do my best to help.

Greetings,
Svetlina
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
ToolTip
Asked by
Nico
Top achievements
Rank 1
Answers by
Tsvetie
Telerik team
Mic
Top achievements
Rank 1
Svetlina Anati
Telerik team
Share this question
or