How to access HyperlinkField in a Gridview?

Posted by Laghaterohan under ASP.NET on 3/23/2011 | Points: 10 | Views : 1991 | Status : [Member] | Replies : 3
Hello,

Can you please let me know how to access HyperlinkField in a gridview?

I cannot change this field to HyperLink as it will result in re-work.

Also, what i need to do is Find my HyperlinkField and then dynamically change its DataNavigationUrlstring.....please help me how to do this?


Thanks

Best Regards,
Rohan Laghate



Responses

Posted by: SheoNarayan on: 3/23/2011 [Administrator] HonoraryPlatinum | Points: 25

Up
0
Down
Convert HyperLinkField to TemplateField, Place the asp:Hyperlink control inside the ItemTemplate and access it by referencing the GridViewRow.

<asp:TemplateField HeaderText="First Name">

<ItemTemplate><asp:HyperLink ID="hyper1" runat="server" ..... /></ItemTemplate>
</asp:TemplateField>


Hope this helps.

Thanks

Regards,
Sheo Narayan
http://www.dotnetfunda.com

Laghaterohan, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Laghaterohan on: 3/23/2011 [Member] Starter | Points: 25

Up
0
Down
Ok thanks!

But i didnt want to use Hyperlink; instead i was thinking if anything could be done using my HyperlinkField itself!

Thanks again..

Best Regards,
Rohan Laghate

Laghaterohan, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Prabhakar on: 3/23/2011 [Member] [MVP] Starter | Points: 25

Up
0
Down
Hi Laghaterohan

say ur full requirement .. u want to link hyperlinkfield to data base field.. say it

Best Regard's
Prabhakar

Laghaterohan, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response