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

Format/Remove Tooltip in Hyperlink column

3 Answers 114 Views
Grid
This is a migrated thread and some comments may be shown as answers.
jing
Top achievements
Rank 1
jing asked on 06 Sep 2010, 05:42 AM

In the column, I had set <nobr> so that it will have only 1 column if i dragged the column width to smaller. But when mouseover the link, the tooltip become <nobr>XXXXX.doc</nobr> not XXXXX.doc. How do I remove the <nobr> or remove the tooltip but still preserve to 1 row event the width turn smaller.

Thanks in advance.

<telerik:GridHyperLinkColumn DataNavigateUrlFormatStringa.aspx?id={0}"
    DataNavigateUrlFields="ID" DataTextFormatString="<nobr>{0}</nobr>" DataTextField="Filename"
    HeaderText="<nobr>Filename</nobr>" UniqueName="Filename" SortExpression="Filename">
</telerik:GridHyperLinkColumn>

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 06 Sep 2010, 08:05 AM
Hello Jing,

I tried adding <nobr> </nobr> only for DataNavigateUrlFormatString and that got worked for me. Give a try with this approach and see whether it helps.

ASPX:
<telerik:GridHyperLinkColumn DataNavigateUrlFormatString="<nobr>'{0}'</nobr>"
    DataNavigateUrlFields="ID" DataTextFormatString="{0}" DataTextField="Filename"
    HeaderText="Filename" UniqueName="Filename" SortExpression="Filename">
</telerik:GridHyperLinkColumn>

Thanks,
Princy.
0
jing
Top achievements
Rank 1
answered on 06 Sep 2010, 08:16 AM
I tried, it give page cannot be displayed error. The DataNavigateUrlFormatString is something like "/folder/a.aspx?id={0}"
0
jing
Top achievements
Rank 1
answered on 06 Sep 2010, 10:32 AM
I removed the tooltip by the code below.

protected void Grid1_ItemDataBound(object sender, GridItemEventArgs e)
{
    if (e.Item.ItemType == GridItemType.Item || e.Item.ItemType == GridItemType.AlternatingItem)
    {
        HyperLink hyperLink1 = (HyperLink)e.Item.Cells[Grid1.MasterTableView.Columns.FindByUniqueName("Filename").OrderIndex].Controls[0];
        hyperLink1.ToolTip = "";
    }
}

Thanks.
Tags
Grid
Asked by
jing
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
jing
Top achievements
Rank 1
Share this question
or