PC Review


Reply
Thread Tools Rating: Thread Rating: 2 votes, 1.00 average.

How to add an hyperlick column to grid view

 
 
Valli
Guest
Posts: n/a
 
      25th Sep 2007
Hi,

I am using a gridview to display data from table. In the gridview, there
are 5 columns in which one column contains link name(eg.
http://www.msn.com).
I want to show this link as an hyperlink & when the user click the link,
the browser should open the link page.
Can anyone explain how to add an hyperlink column & when it got clicked
it should get transferered to the selected web page.
The link page differs for each record in grid view.

I am new to ASP. Please help me in this...

Regards
Valli


 
Reply With Quote
 
 
 
 
Michael Nemtsev, MVP
Guest
Posts: n/a
 
      25th Sep 2007
Hello Valli,

Just add a hyperlink control. You can edit the standard gridview template
http://authors.aspalliance.com/aspxt...ogridview.aspx

---
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo


V> Hi,
V>
V> I am using a gridview to display data from table. In the
V> gridview, there
V> are 5 columns in which one column contains link name(eg.
V> http://www.msn.com).
V> I want to show this link as an hyperlink & when the user click
V> the link,
V> the browser should open the link page.
V> Can anyone explain how to add an hyperlink column & when it got
V> clicked
V> it should get transferered to the selected web page.
V> The link page differs for each record in grid view.
V> I am new to ASP. Please help me in this...
V>
V> Regards
V> Valli


 
Reply With Quote
 
=?Utf-8?B?TWFuaXNo?=
Guest
Posts: n/a
 
      25th Sep 2007
You can add a TemplateField in the GridView control using the Edit Column
option from the context menu when you click on the smart tag (arrow on top og
the Grid).

1. Add a TemplateField in the Selected Fields list.

2. Now Right click on the Grid and select Edit Templates. Now drop the
Hyperlink control in the ItemTemplate of the Grid.

3. Now bind the NavigateURL and Text property of the Hyperlink to the
hyperlink column field in the table using Data Bindings.

4. Now if you click on the hyperlink, it will take you to that page.

Regards,
Manish

"Valli" wrote:

> Hi,
>
> I am using a gridview to display data from table. In the gridview, there
> are 5 columns in which one column contains link name(eg.
> http://www.msn.com).
> I want to show this link as an hyperlink & when the user click the link,
> the browser should open the link page.
> Can anyone explain how to add an hyperlink column & when it got clicked
> it should get transferered to the selected web page.
> The link page differs for each record in grid view.
>
> I am new to ASP. Please help me in this...
>
> Regards
> Valli
>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Grid View sort by column bbawa1@yahoo.com Microsoft ASP .NET 3 13th Apr 2007 08:12 PM
Sorting the Grid view by column bbawa1@yahoo.com Microsoft ASP .NET 1 13th Apr 2007 10:03 AM
how do i add link column in grid view in asp.net 2.0 parez Microsoft ASP .NET 1 19th Jul 2006 06:08 AM
Data Grid View Column Names Joe Griffith Microsoft VB .NET 2 18th Feb 2006 11:34 AM
.NET 2.0 Grid View Control and the hyperlinkfield column Evian Spring Microsoft ASP .NET 2 16th Feb 2006 12:38 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:46 PM.