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

Tooltip on a row

2 Answers 86 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
Jeppe
Top achievements
Rank 1
Jeppe asked on 20 Apr 2009, 05:09 AM
Hi

Is it possible to attach a ToolTip to a row in the RadGrid?

I know this question has been asked around here before but I did not seem to find any answer.

2 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 20 Apr 2009, 12:39 PM
Hello Jeppe,

You can try out the following code to set a tool tip for each row in your grid:
c#:
 protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) 
    { 
        if (e.Item is GridDataItem) 
        { 
            GridDataItem dataItem1 = (GridDataItem)e.Item;         
            dataItem1.Attributes.Add("onMouseOver""return showToolTip('"+dataItem1.ClientID +"');"); 
             
        } 
    } 

js:
<script type="text/javascript"
function showToolTip(ID) 
{  
   var tooltip = $find("<%=RadToolTip1.ClientID %>"); 
   tooltip.set_targetControlID(ID); 
</script> 

Thanks
Princy.
0
Jeppe
Top achievements
Rank 1
answered on 21 Apr 2009, 02:53 AM
Hi

Thanks for the answer. Not sure I got it right cause i get an error on page load.

The control collection cannot be modified during DataBind, Init, Load, PreRender or Unload phases.

EDIT: Ups my fault. Dont put the ToolTip control in the the header section.

Now it works .

Thanks!!!

Tags
ToolTip
Asked by
Jeppe
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Jeppe
Top achievements
Rank 1
Share this question
or