473,725 Members | 2,126 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

HowTo: databound hyperlink in DataGrid?

I would like to have one column in my DataGrid that content acts as a
hyperlink.
In addition to that I would like that the content is databound to a DataSet
source.

If I create a hyperlink column in VS.NET I loose the databinding feature for
that column. If I choose a data bound column I don't get the hyperlink
formatting and actions.

Nov 18 '05 #1
2 2668
Right click on the datagrid and go to Property Builder. Go to the second
choice, which is bound columns (or similar). Uncheck autogenerate checkbox
and add each of the columns. Unfortunately, you will have to know the actual
names of the fields. You can set up a hyperlink column by pulling a
hyperlink column over. You can set different fields for text and URL. For
URL format, it is generally:

pageName.aspx?I D={0}

You then specify the column to use for ID= in the URL text field. Once you
play with it a bit, you will find it to be extremely simple.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************** *************** *************** *************** ***
Think outside the box!
*************** *************** *************** *************** ***
"Alex" <so*****@nospam .com> wrote in message
news:c5******** **@news.mch.sbs .de...
I would like to have one column in my DataGrid that content acts as a
hyperlink.
In addition to that I would like that the content is databound to a DataSet source.

If I create a hyperlink column in VS.NET I loose the databinding feature for that column. If I choose a data bound column I don't get the hyperlink
formatting and actions.

Nov 18 '05 #2
Being new to this, I think I need a little more detail for the second part.
My URL's come from a DB as a column in the dataset.
"Cowboy (Gregory A. Beamer) [MVP]" <No************ @comcast.netNoS pamM> wrote
in message news:O%******** **********@TK2M SFTNGP09.phx.gb l...
Right click on the datagrid and go to Property Builder. Go to the second
choice, which is bound columns (or similar). Uncheck autogenerate checkbox
and add each of the columns. Unfortunately, you will have to know the actual names of the fields. You can set up a hyperlink column by pulling a
hyperlink column over. You can set different fields for text and URL. For
URL format, it is generally:

pageName.aspx?I D={0}

You then specify the column to use for ID= in the URL text field. Once you
play with it a bit, you will find it to be extremely simple.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************** *************** *************** *************** ***
Think outside the box!
*************** *************** *************** *************** ***
"Alex" <so*****@nospam .com> wrote in message
news:c5******** **@news.mch.sbs .de...
I would like to have one column in my DataGrid that content acts as a
hyperlink.
In addition to that I would like that the content is databound to a

DataSet
source.

If I create a hyperlink column in VS.NET I loose the databinding feature

for
that column. If I choose a data bound column I don't get the hyperlink
formatting and actions.


Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2545
by: Alex | last post by:
I would like to have one column in my DataGrid that content acts as a hyperlink. In addition to that I would like that the content is databound to a DataSet source. If I create a hyperlink column in VS.NET I loose the databinding feature for that column. If I choose a data bound column I don't get the hyperlink formatting and actions.
2
1809
by: Alex | last post by:
I'm using a DataGrid with several bound columns. However for one column I had to use a ItemTemplate with a asp:hyperlink in it. How can I switch the hyperlink column into the edit mode in the datagrid event handler? Also, I sit possible to make not allow a field to be edited from within the edit handler?
2
2614
by: BobRoyAce | last post by:
I am brand new to ASP.NET and am now required to take over maintenance of a ..NET/C# web application. On one of the pages I'm working on there is a DataGrid which has multiple columns. One of the columns is not databound and instead has up to three hyperlinks in it (Edit, Award, and Cancel). A couple of the hyperlinks should not be shown in certain cases. Now, mind you, I don't know if it's being done in the way that's best to do it. It...
0
937
by: Benton | last post by:
Hi there, I am using ASP.NET 2.0 and need multiple parameters in Hyperlink column so I add this to my DataGridView: <asp:TemplateField> <ItemTemplate><asp:Hyperlink text="Edit" id="hylEdit" runat="server"></asp:Hyperlink></ItemTemplate> </asp:TemplateField>
3
1904
by: Raja | last post by:
I have a datagrid, it has dropdown box as a column and i have one more column that has hyperlink. The NavigateURL for the hyperlink is to open a new window with a query stirng parameter as the selected value of the drop down... here is how it looks like <asp:datagrid....> .... <asp:TemplateColumn> <ItemTemplate>
3
15409
by: Tim::.. | last post by:
I currently have the following datagrid but want to turn the name and email column into a hyperlink in the codebehind! Can someone please tell me how I achieve this! Thanks Private Sub createTable() Dim tbcontacts As DataTable = New DataTable("contacts") tbcontacts.Columns.Add(" ", System.Type.GetType("System.String"))
19
3557
by: Joe | last post by:
I have an aspx page (referred to here as page_1) with a datagrid whose first column contains hyperlinks. When a user clicks one of these hyperlinks, he will navigate to another aspx page (referred to here as page_2). I need to cache the value of the link's text (hyperlink.text property) so that I can use it in the page_load event of page_2. I've thought of using a hidden field and then calling Request.Form("hdnClickedLinkText") in the...
1
2098
by: Carlos | last post by:
Hi all, I need a field that it is both databound, and hyperlink in a gridview. That is, the value is obtained from a query, and at the same time needs to point to a new page where will be used to make another query. How can this be possible in asp .net? Thanks in advance, Carlos.
1
3034
by: Håkan | last post by:
Hi! How do you format the href field of the <a>-tag when you use a databound BulletedList in Hyperlink mode? The field in the database contains an ID that I want to use as a parameter in the url for the Bulletedlists hyperlink tag. /Håkan
0
8752
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9401
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9257
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9113
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8097
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6702
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4519
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2635
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2157
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.