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

Multiple RadToolTipManagers for RadGrid

3 Answers 119 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jay
Top achievements
Rank 1
Jay asked on 03 Jan 2012, 03:50 PM
I have a RadGrid with two GridTemplateColumns.
i need to tooltipsify the GridTemplateColumns, so i have taken two RadTooltipManager controls on the page

i have written the following code in Grids ItemDataBound event. (Here btnbooking and btnReference are button controls in first  and second Gridtemplatecolumn ) OnAjaxUpdate methods for RadToolTipManager's are OnAjaxUpdateBooking and OnAjaxUpdateReference.
in these methods i am loading Booking.ascx and Reference.ascx usercontrols.

these two usercontrols contains "Close" button, on click of these buttons i need to hide the Tooltip. 

 when i click the close button i am getting the following error.
Sys.WebForms.PageRequestManagerServerErrorException: Invalid JSON primitive:

please find the code in ItemDataBound event, OnAjaxUpdate and Javascript method for hiding tooltip
-- ItemDataBound Event
ToolTipManager1.TargetControls.Add(btnbooking.ClientID, btnbooking.Text,
true);
ToolTipManager2.TargetControls.Add(btnReference.ClientID, btnReference.Text, true);
 
 -- OnAjaxUpdate methods
protected void OnAjaxUpdateBooking(object sender, ToolTipUpdateEventArgs args)
        {
            Control ctrl = Page.LoadControl("~/ControlLibrary/Booking.ascx");
            args.UpdatePanel.ContentTemplateContainer.Controls.Add(ctrl);           
            AppWeb.ControlLibrary.BookingDetails booking = (AppWeb.ControlLibrary.BookingDetails)ctrl;
 
            WTButton btnClose = (WTButton)ctrl.FindControl("btnclose");
            if (btnClose != null)
                btnClose.OnClientClicked = "CloseTooltipManager";
        }
 
        protected void OnAjaxUpdateReference(object sender, ToolTipUpdateEventArgs args)
        {
            Control ctrl = Page.LoadControl("~/ControlLibrary/Reference.ascx");
            args.UpdatePanel.ContentTemplateContainer.Controls.Add(ctrl);           
            AppWeb.ControlLibrary.DualDetails dual = (AppWeb.ControlLibrary.DualDetails)ctrl;
            dual.PageType = ApptType.EXPORT_DROPOFF;
            dual.lGateApptAssoc_Id = Convert.ToInt64(args.Value);           
             
            WTButton btnClose = (WTButton)ctrl.FindControl("btnclose");
            if (btnClose != null)
                btnClose.OnClientClicked = "CloseTooltipManager";                       
        }
 
-- Javascript method
function CloseTooltipManager(sender, args) {
             
 
            var controller = Telerik.Web.UI.RadToolTipController.getInstance();
            var tooltip = controller.get_activeToolTip();
 
            if (tooltip) {
                tooltip.hide();
            }
        }


please anyone help me where i am doing wrong.

Jai

3 Answers, 1 is accepted

Sort by
0
Richard
Top achievements
Rank 1
answered on 03 Jan 2012, 07:04 PM
Jai:

I'm not sure if you've seen this thread, but it might provide a solution for your issue:

 Sys.WebForms.PageRequestManagerServerErrorException: Invalid JSON primitive: Rebind.

Hope this helps.
0
Accepted
Shinu
Top achievements
Rank 2
answered on 04 Jan 2012, 07:07 AM
Hello Jai,

Check the following forum thread which discussed similar scenario.
multiple RadToolTipManager in Radgrid

-Shinu.
0
Jay
Top achievements
Rank 1
answered on 09 Jan 2012, 11:37 AM
Hi Shinu,

i resolved this issue by changing the ID of button in Booking.ascx from btnClose.

if i use "btnClose" for both the buttons in usercontrols i am getting the error.

thanks for you reply.

Thank you once again.

Regards,
Jai
Tags
Grid
Asked by
Jay
Top achievements
Rank 1
Answers by
Richard
Top achievements
Rank 1
Shinu
Top achievements
Rank 2
Jay
Top achievements
Rank 1
Share this question
or