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

Blank ToolTip, dont view any details

1 Answer 87 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
Thaya
Top achievements
Rank 1
Thaya asked on 06 Apr 2010, 02:38 PM

Hi,
I am using toolTip in my Grid, and want to view benefitDetails in a ToolTip when I hold the mouse over a benefit.
A tooltip appear, but I cant see any details when I hold the mouse over a benefit.

Here is my code:
<telerik:RadToolTipManager ID="RadToolTipManager1" OffsetY="-1"
    runat="server" RelativeTo="Element"
    Position="MiddleRight" >
    <TargetControls>
        <telerik:ToolTipTargetControl TargetControlID="RadGrid1" Value="benefitDetails" />
    </TargetControls>
</telerik:RadToolTipManager>
<telerik:RadGrid AutoGenerateColumns="false" ID="RadGrid1" AllowFilteringByColumn="false"
    AllowSorting="false" ShowFooter="True" runat="server" GridLines="None" AllowPaging="false"
    Skin="Outlook" OnColumnCreated="RadGrid1_ColumnCreated" HeaderStyle-CssClass="RgGroupCol"
    OnItemDataBound="RadGrid1_ItemDataBound" OnItemCreated="RadGrid1_ItemCreated">
    <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
    <HeaderStyle BackColor="#507CD1" ForeColor="white" Font-Size="XX-Small" />
    <FooterStyle BackColor="#D3E9BF" CssClass="reportFooter" />
    <GroupHeaderItemStyle Font-Bold="True" ForeColor="White" CssClass="dataHead" />
    <AlternatingItemStyle BackColor="transparent" />
    <MasterTableView ShowGroupFooter="True" AllowMultiColumnSorting="false" DataKeyNames="benefitsId">
        <Columns>
            <telerik:GridTemplateColumn>
                <ItemTemplate>
                   <asp:HyperLink ID="targetControl" runat="server" NavigateUrl="#" Text='<%# Eval("description") %>'></asp:HyperLink>
                </ItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridBoundColumn DataField="basis" HeaderText="Basis" UniqueName="basis"
                HeaderStyle-CssClass="dataHead" DataFormatString="{0:#}">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn Aggregate="Sum" DataField="employerCost" HeaderText="EmployerCost"
                DataFormatString="{0:N0}" UniqueName="employerCost" FooterText="Sum: " HeaderStyle-CssClass="dataHead"
                ItemStyle-HorizontalAlign="Right" HeaderStyle-HorizontalAlign="Right" FooterStyle-HorizontalAlign="Right">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="benefitDetails" UniqueName="benefitDetails" HeaderStyle-CssClass="dataHead"
                Visible="false">
            </telerik:GridBoundColumn>
        </Columns>
        <ItemStyle BackColor="#BFD5E9" />
        <GroupByExpressions>
            <telerik:GridGroupByExpression>
                <GroupByFields>
                    <telerik:GridGroupByField FieldName="category" FieldAlias="category" FormatString=""
                        HeaderText="" SortOrder="None" />
                </GroupByFields>
                <SelectFields>
                    <telerik:GridGroupByField FieldName="categoryDescription" HeaderText=" " FieldAlias="categoryDescription"
                        FormatString="" HeaderValueSeparator=" " />
                </SelectFields>
            </telerik:GridGroupByExpression>
        </GroupByExpressions>
        <RowIndicatorColumn>
            <HeaderStyle BackColor="#507CD1" Width="20px" />
        </RowIndicatorColumn>
        <ExpandCollapseColumn>
        </ExpandCollapseColumn>
    </MasterTableView>
</telerik:RadGrid>


Code behind:
        protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
        {
            if (e.Item.ItemType == GridItemType.Item || e.Item.ItemType == GridItemType.AlternatingItem)
            {
                Control target = e.Item.FindControl("targetControl");
                if (!Object.Equals(target, null))
                {
                    if (!Object.Equals(this.RadToolTipManager1, null))
                    {
                            this.RadToolTipManager1.TargetControls.Add(target.ClientID, (e.Item as GridDataItem).GetDataKeyValue("benefitsId").ToString(), true);

                    }
                }
            }
    }

Anyone can help me?

Thanks,
Thaya

1 Answer, 1 is accepted

Sort by
0
Svetlina Anati
Telerik team
answered on 09 Apr 2010, 08:45 AM
Hi Thaya,

When you are using a RadToolTipManager control and you want to show details you can load the content with the details in two manners:

1) By using AJAX and the OnAjaxUpdate event as shown in the demos below:

http://demos.telerik.com/aspnet-ajax/tooltip/examples/default/defaultcs.aspx
http://demos.telerik.com/aspnet-ajax/tooltip/examples/loadondemand/defaultcs.aspx

2) By using WebService as explained below:

http://demos.telerik.com/aspnet-ajax/tooltip/examples/webservice/defaultcs.aspx
http://demos.telerik.com/aspnet-ajax/tooltip/examples/onclientresponseend/defaultcs.aspx

In the provided code snippet I can only see that you attach the tooltips but I do not see where you actually load any content in them. Please examine the provided links and choose one of the approaches to load the tooltip content. If you have any further questions, do not hesitate to contact us again.

Sincerely yours,
Svetlina
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
ToolTip
Asked by
Thaya
Top achievements
Rank 1
Answers by
Svetlina Anati
Telerik team
Share this question
or