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

Grid Hierarchy not working inside RadToolTipManager

6 Answers 71 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
Meng
Top achievements
Rank 1
Meng asked on 10 Dec 2012, 07:41 PM
Hi There,

I am using DetailTables inside a radgrid, which is inside of a RadToolTipManager user control. When the tooltipmanager user control pops up, the radgrid data for first level is displaying well, but the expand button is not working (cannot see the data of the second level), Any help or suggestions would be greatly appreciated. Thank you.

6 Answers, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 11 Dec 2012, 01:55 PM
Hello Meng,

I just tried this scenario by taking this online example and placing it in a user control that will be loaded by the RadToolTipManager. It seems to work fine (see the attached project and screen capture). Note that the controls that the tooltipmanager loads are recreated when its OnAjaxUpdate event fires, which is after Page_Init and before Page_Load, so if you have earlier code that is related to the logic you should move it to a place when the control have been recreated (e.g. page_Load or PreRender). This goes for the user control as well, I advise on using the Page_PreRender event to make changes as advised in this help article). 

Generally, what the RadToolTipManager does is load the user control each time inside an UpdatePanel. If you are having difficulties with this scenario you can make it simpler by loading your user control dynamically inside an UpdatePanel to debug it easily. Once it works in that case (ajax requests adding the UC and persisting it across postbacks) it should work for the tooltip manager as well.


Regards,
Marin Bratanov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Meng
Top achievements
Rank 1
answered on 11 Dec 2012, 03:23 PM
Hi Marin,

I thought the issue was resolved, but it turns out it is still there. The scenario you provided is that the tooltipmanager is bound to one label only, but in my project, the tooltipmanager is bound to a radgrid, which passes different ids to the tooltipmanager, then the tooltipmanager displays a two level datagrid based on the id, Could you please provide an example based on this scenario? Thanks a lot for your help.
0
Meng
Top achievements
Rank 1
answered on 12 Dec 2012, 04:41 PM
Hi there,
 
Can anyone help me out with this issue please?

Regards,
Meng
0
Marin Bratanov
Telerik team
answered on 14 Dec 2012, 11:15 AM
Hi Meng,

Whether there are multiple targets or just one is not relevant to this case. You can easily extend my previous example to use grid rows as targets by following this demo or this one. What I can advise is that you examine the demos and my example, then compare them with your actual case. You should also add a breakpoint in the OnAjaxUpdate event handler and in your user control and step through the code to see if a serve error is thrown in your case. If it is, the MS AJAX framework will trap it and show it on the client as an error that can be easily missed. You should also make sure you store the ID properly in your user control so you can pass it. You can see the second demo I linked uses a property of the UC to store data in the ViewState.


All the best,
Marin Bratanov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Meng
Top achievements
Rank 1
answered on 14 Dec 2012, 02:06 PM
Hi Marin,

Thanks for your help. I have read through the demo you provided above, but that still does not resolve the problem. I have a target datagrid, a tooltipmanager, and a hierarchy grid inside the tooltipmanager. The issue I have now is:

The Hierarchy Grid expand/collapse works fine if I do not put its databind ( comment out RadGridDataBind() ) in the OnPreRender method of the user control, the databind is executed in OnNeedDataSource and OnDetailTableDataBind handler, but the Hierarchy Grid data in the tooltipmanager doesnot refresh when I move from one row to another of the target datagrid.

If I put Hierarchy Grid databind in the OnPreRender method of the user control, the data in the tooltipmanager refreshes when I move the mouse over the target datagrid, but the expand/collapse of the Hierarchy Grid inside the tooltipmanager stops working.

 

 

           protected override void OnPreRender(EventArgs e)
        {
            base.OnPreRender(e);
            RadGridDataBind();
        }
  
        protected void RadGridDataBind()
        {
            radgrid.DataSource = GetGridDataFromDB();
            radgrid.DataBind();
        }
  
        protected void RadGrid_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
        {
  
            if (!e.IsFromDetailTable)
            {
                radgrid.DataSource = GetGridDataFromDB();
            }
        }
  
        protected void RadGrid_DetailTableDataBind(object source, Telerik.Web.UI.GridDetailTableDataBindEventArgs e)
        {
  
            GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem;
            switch (e.DetailTableView.Name)
            {
                case "UserList":
                    {
  
                        e.DetailTableView.DataSource = GetDetailTableDataFromDB();
                        break;
                    }
            }
  
        }
Any suggestions?

Thanks,
Meng
0
Accepted
Marin Bratanov
Telerik team
answered on 18 Dec 2012, 02:51 PM
Hello Meng,

I have created a knowledge base article to explain this case in greater detail. It also offers two sample project for download, so you can use them as base for your scenario. You can find it here: http://www.telerik.com/support/kb/aspnet-ajax/tooltip/radgrid-hierarchy-in-radtooltipmanager.aspx.


Kind regards,
Marin Bratanov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
ToolTip
Asked by
Meng
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Meng
Top achievements
Rank 1
Share this question
or