Add RadTooltip to entire row of radgrid, NOT just cell

9 posts, 1 answers
  1. Derek
    Derek avatar
    118 posts
    Member since:
    Oct 2008

    Posted 26 Sep 2011 Link to this post

    We have a scenario where there is a column that contains html-formatted text, which could run into several paragraphs. We'd like to have this show up in a tooltip when the mouse is hovered anywhere over the grid row, not just on a single cell.

    Is that possible? Any code examples?

    Thanks in advance.
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 26 Sep 2011 Link to this post

    Hi Derek,

    You can use the following code to add tooltip to entire row of radgrid.

    C#:
    protected void grid1_ItemDataBound(object sender, GridItemEventArgs e)
    {
       if (e.Item is GridDataItem)
      {
        GridDataItem gridItem = e.Item as GridDataItem;
        gridItem.ToolTip ="sample Text";
      }
    }

    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Derek
    Derek avatar
    118 posts
    Member since:
    Oct 2008

    Posted 27 Sep 2011 Link to this post

    Thanks for the response, but I'm wondering about adding a RadToolTip on the radgrid row, not the standard .net tooltip. Is that possible?
  5. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 27 Sep 2011 Link to this post

    Hi Derek,

    You can go through the following link.
    http://demos.telerik.com/aspnet-ajax/tooltip/examples/tooltipversustooltipmanager/defaultcs.aspx

    Thanks,
    Shinu.
  6. Derek
    Derek avatar
    118 posts
    Member since:
    Oct 2008

    Posted 27 Sep 2011 Link to this post

    Thanks Princy; we tried that approach and it seems to work, but for some reason the tooltips are created without any content. Here's the code we're using;

    Protected Sub RadGridCommitments_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles RadGridCommitments.ItemDataBound
            If TypeOf (e.Item) Is GridDataItem Then
                Dim row As GridDataItem = DirectCast(e.Item, GridDataItem)
                Dim lsTip As String = row("CommitmentDetails").Text
                RadToolTipManager1.TargetControls.Add(e.Item.ClientID, lsTip, True)
            End If
        End Sub

    The tooltip is rendered and attached to the right object, but appears to be empty. If we examine the items as they are created, the variable lsTip contains text, but when the tooltip is rendered it's empty.

    Any ideas?
  7. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 28 Sep 2011 Link to this post

    Hi Derek,

    I suppose you want to use RadToolTip in place of standard .net tooltip.
    If that is the vase the easy method is to add one RadToolTipManager with AutoTooltipify as 'true' like below.

    ASPX:
    <telerik:RadToolTipManager ID="RadToolTipManager1" runat="server" AutoTooltipify="true" BackColor="BlueViolet" Skin="Web20">
    </telerik:RadToolTipManager>

    Thanks,
    Shinu.
  8. Derek
    Derek avatar
    118 posts
    Member since:
    Oct 2008

    Posted 28 Sep 2011 Link to this post

    We've experimented with the AutoToolTipify, but it doesn't seem to accomplish what we're looking for.

    Is there a working example available that incorporates RadToolTips on a RadGrid, either on a specific column or on the entire row?

    Thanks in advance.
  9. Answer
    Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 29 Sep 2011 Link to this post

    Hello Derek,

    When you are adding the RadToolTipManager with autoToolTipify property true will convert the standard ToolTip to RadToolTip. Here is the full code which worked as expected.
    C#:
    protected void rg1_ItemDataBound(object sender, GridItemEventArgs e)
     {
       if (e.Item is GridDataItem)
         {
           string lsTip = item["EmployeeID"].Text;
           item.ToolTip = lsTip;//Its style will be style of the RadToolTipManager style.
         }
     }

    aspx:
    <telerik:RadGrid runat="server" ID="rg1" . . . >
    </telerik:RadGrid>
    <telerik:RadToolTipManager ID="RadToolTipManager1" runat="server"  AutoTooltipify="true"   Width="100px" Skin="Black">
    </telerik:RadToolTipManager>

    Thanks,
    Shinu.
  10. Kishor
    Kishor avatar
    82 posts
    Member since:
    Oct 2012

    Posted 26 Sep 2014 Link to this post

    hello

    how can I open a Radtooltip on Radgrid row click event.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017