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

Adding ID to Hyperlink in Grid Control

1 Answer 163 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Joe
Top achievements
Rank 1
Joe asked on 08 Jun 2009, 07:31 PM
Hi,
How can I add an unique Id value to the URL in a hyperlink column:
Here is the code I have:

<telerik:GridHyperLinkColumn DataNavigateUrlFields="Firstname" UniqueName="FirstName" 
                                    DataNavigateUrlFormatString="VPCLeadDetails.aspx" DataTextField="Firstname" HeaderText="First Name" SortExpression="Firstname"

I tried searching on these topics and find it somewhat difficult with all the control properties available to me and not really knowing if I'm looking at the right property.

Thanks,

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 09 Jun 2009, 05:22 AM
Hello Joe,

If you have the id field specified in the grid then you can set the DataNavigateUrlFormatString of the HyperLinkColumn accordingly so as to pass an Id to the Url. Check out the example below:

aspx:
<telerik:GridHyperLinkColumn   
                        DataNavigateUrlFields="Firstname,ID" UniqueName="FirstName" 
                        DataNavigateUrlFormatString="VPCLeadDetails.aspx?Id={1}"  
                        HeaderText="First Name" DataTextField="Firstname">          
</telerik:GridHyperLinkColumn>  

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