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

radgrid hyper link

2 Answers 117 Views
Grid
This is a migrated thread and some comments may be shown as answers.
mohamed
Top achievements
Rank 1
mohamed asked on 29 Jun 2011, 01:20 PM


i want to process two things in hyperline ,

Tooltipmanage,
another one's move to another page that moves how i get that value in query string

 <telerik:GridTemplateColumn SortExpression="Articleid">
                                <ItemTemplate>
                                    <asp:HyperLink ID="Articleid" runat="server" NavigateUrl="KBaseDetail.aspx" Text='<%# Eval("Articleid") %>'></asp:HyperLink>
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>


Thanks,
Mohamed.

2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 29 Jun 2011, 01:54 PM
Hello Mohamed,

RadGrid has inbuilt hyperlinkcolumn and which can be used for navigation. You need to specify the DataNavigateUrlFields as the Date field and set the DataNavigateUrlFormatString accordingly to accept this value as the parameter.

aspx:
<telerik:GridHyperLinkColumn DataTextFormatString="Search Google for '{0}'" DataNavigateUrlFields="CompanyName"
  UniqueName="CompanyName" DataNavigateUrlFormatString="http://www.google.com/search?hl=en&q={0}&btnG=Google+Search"
  DataTextField="CompanyName">
</telerik:GridHyperLinkColumn>

You can add the tooltip as follows.
C#:
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
    {
        if (e.Item is GridDataItem)
        {
            GridDataItem item = (GridDataItem)e.Item;
            HyperLink link = (HyperLink)item["CompanyName"].Controls[0];
            link.ToolTip = "YourTextHere!!";
        }
    }

Also check the following help documentation.
Grid / Column Types.

Thanks,
Princy.
0
mohamed
Top achievements
Rank 1
answered on 29 Jun 2011, 01:57 PM
problem resolved,

             if (e.Item is GridDataItem)
            {
                GridDataItem item = (GridDataItem)e.Item;
                HyperLink link = (HyperLink)item.FindControl("Articleid");
                link.NavigateUrl = ("KBaseDetail.aspx?ArticleID='" + link.Text + "'");
            }

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