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

Add RadTooltip to entire row of radgrid, NOT just cell

8 Answers 365 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Derek
Top achievements
Rank 1
Derek asked on 26 Sep 2011, 08:38 PM
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.

8 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 1
answered on 27 Sep 2011, 04:52 AM
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.
0
Derek
Top achievements
Rank 1
answered on 27 Sep 2011, 10:11 AM
Thanks for the response, but I'm wondering about adding a RadToolTip on the radgrid row, not the standard .net tooltip. Is that possible?
0
Shinu
Top achievements
Rank 1
answered on 27 Sep 2011, 02:02 PM
Hi Derek,

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

Thanks,
Shinu.
0
Derek
Top achievements
Rank 1
answered on 27 Sep 2011, 07:28 PM
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?
0
Shinu
Top achievements
Rank 1
answered on 28 Sep 2011, 06:31 AM
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.
0
Derek
Top achievements
Rank 1
answered on 28 Sep 2011, 08:19 PM
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.
0
Accepted
Shinu
Top achievements
Rank 1
answered on 29 Sep 2011, 07:03 AM
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.
0
Kishor
Top achievements
Rank 2
answered on 26 Sep 2014, 05:54 AM
hello

how can I open a Radtooltip on Radgrid row click event.
Tags
Grid
Asked by
Derek
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 1
Derek
Top achievements
Rank 1
Shinu
Top achievements
Rank 1
Kishor
Top achievements
Rank 2
Share this question
or