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

How to Display Grid inside RadTooltip?

1 Answer 120 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Anshul
Top achievements
Rank 1
Anshul asked on 25 Jul 2008, 02:05 PM
Hi,

I have a grid that I want to add tooltip capabilities to. I tried using the
Tooltipmanager. For some reason when I dynamically add the grid rows or grid controls as target controls to the Manager, the flyout tooltip never gets fired. So using the Tooltip manager with a ascx user control would not be option at this time.

After spending considerable time on it and looking at different online examples, we decided to use just the regular RadTooltip. This works on the grid and I am able to display dynamic content in the tooltip.

The question I have is that, would it possible to display a grid inside of a Radtooltip(not using the tooltipmanager ascx user control method). 

If I am able to use a RadGrid or a regular ASP.net Grid inside of the <RadTooltip> tags, how would I go about binding this grid to a datasource like a datatable in the markup or through code behind.
Following is the markup for my grid that the tooltip functionality is applied to. The tooltip section is marked in red:

<

telerik:RadGrid runat="server" AllowPaging="True" ID="RadGridReports" Height="320px" PagerStyle-Mode="Slider"

Width="375px" GridLines="None" AutoGenerateColumns="false" ClientSettings-ClientEvents-OnRowDropping="onGridReportsRowDropping"

ClientSettings-EnablePostBackOnRowClick="true" ClientSettings-ClientEvents-OnRowDragStarted="onGridReportsNodeDragging">

<MasterTableView>

<columns>

<telerik:GridBoundColumn DataField="TemplateID" HeaderText="TemplateID"

SortExpression="TemplateID" Visible="false" UniqueName="TemplateID" />

<telerik:GridBoundColumn DataField="TemplateName" HeaderText="Saved Templates"

SortExpression="TemplateName" Visible="true" UniqueName="TemplateName" />

<telerik:GridTemplateColumn HeaderText="View Details" SortExpression="ViewDetails" UniqueName="ViewDetails">

<ItemTemplate>

<asp:Label ID="lbl" runat="server" Text="Hover to show a tooltip"></asp:Label>

<telerik:RadToolTip ID="RadToolTip1" runat="server" TargetControlID="lbl" RelativeTo="Element" Skin="Default"

Position="BottomLeft">

There are

<%

#DataBinder.Eval(Container, "DataItem.TemplateID")%>

customers from

<%

#DataBinder.Eval(Container, "DataItem.TemplateName")%>

</telerik:RadToolTip>

</ItemTemplate>

</telerik:GridTemplateColumn>

 

</columns>

<RowIndicatorColumn Visible="False">

<HeaderStyle Width="20px" />

</RowIndicatorColumn>

<ExpandCollapseColumn Resizable="False" Visible="False">

<HeaderStyle Width="20px" />

</ExpandCollapseColumn>

<EditFormSettings>

<PopUpSettings ScrollBars="None" />

</EditFormSettings>

</MasterTableView>

<ClientSettings AllowRowsDragDrop="True">

<Selecting AllowRowSelect="True" EnableDragToSelectRows="True"/>

</ClientSettings>

</telerik:RadGrid>

any help would be appreciated

1 Answer, 1 is accepted

Sort by
0
Nikolay Rusev
Telerik team
answered on 28 Jul 2008, 11:18 AM
Hello Anshul,

As I can see from the code you have posted you need to change the following lines

<%#DataBinder.Eval(Container, "DataItem.TemplateID")%>   
<%#DataBinder.Eval(Container, "DataItem.TemplateName")%> 

to this instead

<%#Eval("TemplateID")%>   
<%#Eval("TemplateName")%> 

The other code will working properly.

Kind regards,
Nikolay
Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
General Discussions
Asked by
Anshul
Top achievements
Rank 1
Answers by
Nikolay Rusev
Telerik team
Share this question
or