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

Only 1st Item in radGrid shows tooltip

2 Answers 79 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
Amir Setoudeh
Top achievements
Rank 1
Amir Setoudeh asked on 21 Sep 2009, 09:13 PM
PLEASE IGNORE THIS.  IT WAS A SIMPLE HTML ISSUE.  I COULD NOT FIGURE OUT HOW TO DELETE A THREAD!


I am implementing a radGrid with a custom ItemTemplate.  I am adding a tooltip declaratively in the ItemTemplate, and binding the tooltip to a targetcontrol in the grid's ItemDataBound event.  The result is that only the FIRST row will properly display the tooltip.

(simplified version of the code):
 <telerik:RadGrid ID="grdFilter" runat="server" GridLines="None" AllowPaging="true" AllowSorting="true" ShowHeader="false"  
                           PageSize="18" OnPreRender="grdFilter_PreRender" OnNeedDataSource="grdFilter_NeedDataSource" OnItemDataBound="grdFilter_ItemDataBound" 
                            OnItemCreated="grdFilter_ItemCreated" OnItemCommand="grdFilter_ItemCommand"
<MasterTableView ItemStyle-CssClass="grdAAP" AlternatingItemStyle-CssClass="grdAAP" PagerStyle-Mode="Slider"
<ItemTemplate> 
                              <telerik:RadToolTip ID="RadToolTip1" runat="server" IsClientID="true" RelativeTo="Element" Position="Center"
                              <asp:PlaceHolder ID="phToolTip" runat="server"></asp:PlaceHolder> 
                            </telerik:RadToolTip> 
<asp:panel ID="itemcontainer" CssClass="item" runat="server"
 <asp:Label ID="lblDetails" runat="server" Text="Details..."></asp:Label> 
</asp:panel> 
</ItemTemplate> 
                <PagerStyle Position="Top" AlwaysVisible="true" /> 
     </MasterTableView> 
</telerik:RadGrid> 

On the ItemDataBound event, I populate the ToolTip with the contents of a UserControl
 protected void grdFilter_ItemDataBound(object source, Telerik.Web.UI.GridItemEventArgs e) 
        { 
            if (e.Item is GridDataItem) 
            { 
 DataRowView dvthis = (DataRowView)e.Item.DataItem; 
 PlaceHolder phTooltip = (PlaceHolder) e.Item.FindControl("phToolTip"); 
                RadToolTip rTooltip = (RadToolTip)e.Item.FindControl("RadToolTip1"); 
                Label lblTT = (Label) e.Item.FindControl("lblDetails"); 
                rTooltip.TargetControlID = lblTT.ClientID; 
                rTooltip.IsClientID = true
 String sku = dvthis["SKU"].ToString(); 
                Control ctrl = LoadControl("AAPTooltip.ascx"); 
                AAPTooltip details = (AAPTooltip)ctrl; 
                details.productID = sku; 
 
                phTooltip.Controls.Add(details); 
       } 

The result is that only the FIRST item in the grid will properly display the tooltip.  It is important to note that the end result of the grid is NOT the typical row grid, but rather three columns of "rows" next to eachother, similar to this example:
http://demos.telerik.com/aspnet-ajax/grid/examples/programming/listview/defaultcs.aspx


Thank you.




2 Answers, 1 is accepted

Sort by
0
Amir Setoudeh
Top achievements
Rank 1
answered on 21 Sep 2009, 11:40 PM
PLEASE IGNORE THIS.  IT WAS A SIMPLE HTML ISSUE.  I COULD NOT FIGURE OUT HOW TO DELETE A THREAD!
0
Lars Meyer
Top achievements
Rank 2
answered on 07 Oct 2010, 04:19 PM
Nice when people share the solution...  :-|
Tags
ToolTip
Asked by
Amir Setoudeh
Top achievements
Rank 1
Answers by
Amir Setoudeh
Top achievements
Rank 1
Lars Meyer
Top achievements
Rank 2
Share this question
or