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