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

Unable to open tooltip on click of hyperlink which is in radGrid

1 Answer 113 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
Ram
Top achievements
Rank 1
Ram asked on 02 Jul 2009, 12:42 PM

Hi

 

I want to open a tooltip on click of a hyper link in radGrid,

I declared hyperlink in Template column as follows

 

                                             <telerik:GridTemplateColumn HeaderText="Request Status">

                                                        <ItemTemplate>

                                                            <asp:LinkButton ID="lnkHyper" runat="server" Text="Click"

                                                                OnClick="lnkHyper_Click"></asp:LinkButton>

                                                        </ItemTemplate>

                                                    </telerik:GridTemplateColumn>

 

 

and my tooltip is as follows:

 

<telerik:RadToolTip ID="ConfirmToolTip" runat="server" Height="200px" Width="500px" TargetControlID="lnkHyper"

            ManualClose="True" Position="Center" ShowCallout="False" Title="Confirmation Required"

            Modal="True" Skin="Default1" EnableEmbeddedSkins="false" ShowEvent="OnClick" IsClientID="true">

            <div>

            <div>

            <asp:Literal ID="ltClaim" Text="Do You Want to Confirm" runat="server" />

            </div>

            <div class="cmb_btnG cmb_ltFlt">

                <asp:Button ID="btnOK" Text="OK" runat="server" CssClass="cmb_btnG" OnClick="btnOK_Click" />

            </div>

            <div class="cmb_sp13 cmb_ltFlt">

            </div>

            <div class="cmb_btnG ">

                <asp:Button ID="btnCancel" Text="Cancel" runat="server" CssClass="cmb_btnG"  />

            </div>

        </div>

</telerik:RadToolTip>

 

 

In code behind I am writing following code to open the tooltip but my tooltip never opens, I am also debugged the code, debugger passes through the code but still the tooltip is not opening

 

 protected void lnkHyper_Click(object sender, EventArgs e)

        {

LinkButton _lnkhyper = (LinkButton)sender;

                TableCell cell = _lnkhyper .Parent as TableCell;

GridDataItem item = cell.Parent as GridDataItem;

 

bool reqired=true;

 

if(required)

{

ConfirmToolTip.Show();

return;

}

}

 
I am unable to figure out the problem can any one help

Thanks

1 Answer, 1 is accepted

Sort by
0
Svetlina Anati
Telerik team
answered on 06 Jul 2009, 11:46 AM
Hi Ram,

The grid is an INaming Container and this means that it changes the IDs of the controls in the Item Template - that is why your hyperlink actually does not have ClientID which is lnkHyper and thus the tooltip does not where to show.

What I suggest is to put the tooltip in the item template as shown in the following demo:

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

Note, also that since you have ShowEvent = OnClick in the markup, you do not need to explicitly call the server method Show() - the tooltip will automatically show when you click on the hyperlink as long as it is correctly configured to find its actual target control.  More information about the ShowEvent property is available below:

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

Sincerely yours,
Svetlina
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
ToolTip
Asked by
Ram
Top achievements
Rank 1
Answers by
Svetlina Anati
Telerik team
Share this question
or