Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > Hyperlink column in datagrid

Reply
Thread Tools

Hyperlink column in datagrid

 
 
ReidarT
Guest
Posts: n/a
 
      10-22-2004
I am trying to insert a hyperlink column in a datagrid
the field consist of a http://www.something.no/text.asp?id=FieldID
where FieldID is the field from the sql-server
I normally would have concatenated the text and the field
"http:\\www.something.no/text.asp?id=" & FieldID,
but I don't know how to "grab" the field in the propertybuilder of the
datagrid.

reidarT


 
Reply With Quote
 
 
 
 
Jos
Guest
Posts: n/a
 
      10-22-2004
ReidarT wrote:
> I am trying to insert a hyperlink column in a datagrid
> the field consist of a http://www.something.no/text.asp?id=FieldID
> where FieldID is the field from the sql-server
> I normally would have concatenated the text and the field
> "http:\\www.something.no/text.asp?id=" & FieldID,
> but I don't know how to "grab" the field in the propertybuilder of the
> datagrid.


I'm afraid you can't do this in a hyperlink column.

I suggest converting the hyperlink column to a template
column, and using a databinding expression like this:

<a href="http://www.something.no/text.asp?id=<%#
Databinder.Eval(Container.dataItem,"FieldID")
%>">click here</a>

--

Jos


 
Reply With Quote
 
 
 
 
ReidarT
Guest
Posts: n/a
 
      10-24-2004
Thanks for your answer but this works fine now. If you use the property
builder and select the field in the URL field and the prefix in the URL
fromat string it works fine.
reidarT
"Jos" <(E-Mail Removed)> skrev i melding
news:%(E-Mail Removed)...
> ReidarT wrote:
>> I am trying to insert a hyperlink column in a datagrid
>> the field consist of a http://www.something.no/text.asp?id=FieldID
>> where FieldID is the field from the sql-server
>> I normally would have concatenated the text and the field
>> "http:\\www.something.no/text.asp?id=" & FieldID,
>> but I don't know how to "grab" the field in the propertybuilder of the
>> datagrid.

>
> I'm afraid you can't do this in a hyperlink column.
>
> I suggest converting the hyperlink column to a template
> column, and using a databinding expression like this:
>
> <a href="http://www.something.no/text.asp?id=<%#
> Databinder.Eval(Container.dataItem,"FieldID")
> %>">click here</a>
>
> --
>
> Jos
>
>



 
Reply With Quote
 
Scott Mitchell [MVP]
Guest
Posts: n/a
 
      10-24-2004
Jos wrote:
> ReidarT wrote:
>
>>I am trying to insert a hyperlink column in a datagrid
>>the field consist of a http://www.something.no/text.asp?id=FieldID
>>where FieldID is the field from the sql-server
>>I normally would have concatenated the text and the field
>>"http:\\www.something.no/text.asp?id=" & FieldID,
>>but I don't know how to "grab" the field in the propertybuilder of the
>>datagrid.

>
>
> I'm afraid you can't do this in a hyperlink column.
>
> I suggest converting the hyperlink column to a template
> column, and using a databinding expression like this:
>
> <a href="http://www.something.no/text.asp?id=<%#
> Databinder.Eval(Container.dataItem,"FieldID")
> %>">click here</a>


You most certainly can have a HyperLinkColumn with a dynamic value in
the querystring. The downside of a HyperLinkColumn is that it only
allows *one* dynamic querystring value for the rendered hyperlink. If
you need two or more values in the querystring that are from the data
bound to the DataGrid, then you will have to use a TemplateColumn, as
you mention.

For more on the HyperLinkCoumn and hyperlinks in DataGrids, check out
the "Hyperlinks" FAQ section at http://datawebcontrols.com/faqs/




--

Scott Mitchell
http://www.velocityreviews.com/forums/(E-Mail Removed)
http://www.4GuysFromRolla.com

* When you think ASP.NET, think 4GuysFromRolla.com!
 
Reply With Quote
 
Bob the Builder
Guest
Posts: n/a
 
      10-28-2004
I have a tricky problem.

I have a datagrid with multiple rows. In each row, I have a column
that needs to display multiple hyperlinks.

In other words each row has an id, seq no. ship no and the potential
for one or many partcodes. Each part code when clicked needs to open a
new page based upon that part code.

I have many rows in the datagrid and each row is unique in that it can
have one or more than one part code.

Have any of you done this before?

I have tried many different ways and have come up empty. Any help
would be greatly appreciated.

BUZZMAN

On Sun, 24 Oct 2004 11:00:43 +0200, "ReidarT" <(E-Mail Removed)> wrote:

>Thanks for your answer but this works fine now. If you use the property
>builder and select the field in the URL field and the prefix in the URL
>fromat string it works fine.
>reidarT
>"Jos" <(E-Mail Removed)> skrev i melding
>news:%(E-Mail Removed)...
>> ReidarT wrote:
>>> I am trying to insert a hyperlink column in a datagrid
>>> the field consist of a http://www.something.no/text.asp?id=FieldID
>>> where FieldID is the field from the sql-server
>>> I normally would have concatenated the text and the field
>>> "http:\\www.something.no/text.asp?id=" & FieldID,
>>> but I don't know how to "grab" the field in the propertybuilder of the
>>> datagrid.

>>
>> I'm afraid you can't do this in a hyperlink column.
>>
>> I suggest converting the hyperlink column to a template
>> column, and using a databinding expression like this:
>>
>> <a href="http://www.something.no/text.asp?id=<%#
>> Databinder.Eval(Container.dataItem,"FieldID")
>> %>">click here</a>
>>
>> --
>>
>> Jos
>>
>>

>


 
Reply With Quote
 
 
 
Reply

Thread Tools

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
gridview column values to another page via gridview hyperlink column Keith G Hicks ASP .Net 3 02-18-2008 06:17 AM
How to add a hyperlink column to asp.net datagrid - where only one value is a hyperlink davetichenor ASP .Net 1 10-30-2006 02:57 PM
How to add a hyperlink column to asp.net datagrid - where only one value is a hyperlink Dave ASP .Net Datagrid Control 0 10-21-2006 07:48 PM
How to assign a column of URLs to Hyperlink Column of a DataGrid c =?Utf-8?B?ZGF2aWQ=?= ASP .Net 11 07-17-2006 07:20 PM
HyperLink Column and Button Column in a DataGrid =?Utf-8?B?V2FyYW4=?= ASP .Net 0 08-09-2005 12:00 AM



Advertisments