473,809 Members | 2,776 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Datagrid - HyperLinkColumn

Hi all,

I have just added a hyperlink column to my datagrid - however I am having
some troubles getting it to behave as I would like...

My objective is to have a hyperlink that I can click on - it doesn't take
the page anywhere (ie, javascript:void (0);) - but I want an onClick event
for it.

I can normally do this kinda thing with a 'Attributes' property of the
object - however the HyperLinkColumn doesn't appear to have one of these.

Can anyone advise me how I can achieve this please.

The end game is to have one of the columns that has a value from the
database become the hyperlink - however - for now I've just added a 3rd
column which has the word "Select" etc..

Code as follows:

' Create new instances of our bound column objects
dgCol3 = New HyperLinkColumn

dgCol3.Text = "Select"
dgCol3.Navigate Url = "javascript:voi d(0)"
dgCol3.HeaderTe xt = ""
dgCol3.HeaderSt yle.CssClass = "normalText "
dgCol3.HeaderSt yle.Font.Bold = True

Any information would be appreciated - please note that other than the
server control for the datagrid - all of the columns are being added
programmaticall y rather than embedded into the HTML.

Thanks

Rob
Nov 18 '05 #1
1 1421
I should add that I am also looking at the TemplateColumn and am strugging
with that also - are these inbound controls only? I dont seem to be able to
add them programmitcally ..

Regards

Rob
Nov 18 '05 #2

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

Similar topics

0
4846
by: Jongmin | last post by:
Hi! I am making HyperLinkColumn in datagrid. It is simple to make the hyerlinkcolumn with one datafield. <asp:HyperLinkColumn Text="NAME" DataNavigateUrlField="NAME" DataNavigateUrlFormatString="http://www.aaa.com?Name={0}" SortExpression="NAME" />
4
280
by: cooltech77 | last post by:
hi all, I am a newbie and i need some help.I have datagrid on my asp.net page which has hyperlink columns. the datagrid configuration in the aspx page is as follows <asp:DataGrid id="dgNewsLinks" DataKeyField="News_ID" runat="server" Width="283px" AutoGenerateColumns="False" GridLines="None" ShowHeader="False"> <Columns> <asp:HyperLinkColumn Target="_parent" DataNavigateUrlField="url"
2
1332
by: ltt19 | last post by:
Hi. I have a DataGrid control that has one HyperLinkColumn, and this page has a "default.css" loaded, so, the link Style of the DataGrid is the same of the css document... but I want to change it, the link style of the Datagrid must be different from the others.. Even if I set all the format of the datagrid, everything changes... except the link style. Anyone know any way to fix this? I do not know even if I could do this in the css...
2
1712
by: Tim::.. | last post by:
Hi Can someone please tell me why my datagrid doesn't populate with data properly... For some reason the DataNavigateUrlFormatString populates ok but Text doesn't??? E.G: Text="<%Container.DataItem(Name) %>" I would really appritiate any help!
0
240
by: Tim::.. | last post by:
Can someone please tell me how I can get the following JavaScript to work inside this datagrid! What I'm trying to do is to have a layer that shows up with an image of an employee when you onMouseOver an icon in the datagrid! Some how I need each icon to have a different id that relates to an image record in a database... At the moment I'm using Active Directory to pull the users details from...
1
2827
by: Roy | last post by:
I'm assuming this is amazingly simple and I'm just missing the boat. On the html side of an asp.net page I have a datagrid, a "search" button, and 8 text boxes for search criteria. A user enters in varying search criteria, hits "search", info is passed to a stored proc, results return and displayed in the datagrid. Every field in the datagrid is numeric (indicative of a certain sum or total) data but also functions as a...
4
4409
by: sakieboy | last post by:
I currently have a datagrid with several columns. The first column in the DataGrid is a HyperLinkColumn. When I select a row, I would like for this HyperlinkColumn to fire. I have the mouseover colors changing, and I have the routine, but I can't seem to get the HyperLinkColumn to fire.... Private Sub MyDataGrid_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles...
2
1688
by: OutlookNewbieDev | last post by:
Hello, I'm new to ASP.NET but have done quite a bit of classic ASP. I need to drill down to another page from the DataGrid using a record's ID. In classic ASP, this was quite easy but I can't find anything equivalent in ASP.NET. For example, I need to go from a page that lists Customers to a page for CustomerDetails by allowing the user to click anywhere on the row of the DataGrid.
0
1932
by: virendra.chandra | last post by:
in datagrid cellpadding is not working. can u suggest what could be the possible error. this is my code <asp:datagrid id="test1" Runat="server" Width="700" Enabled="True" AutoGenerateColumns="False" Font-Size="8pt" PagerStyle-Wrap="True" AllowSorting="True" CellSpacing="2" CellPadding="3" GridLines="Vertical" ItemStyle-Wrap=True HeaderStyle-Wrap=True
2
1674
by: tshad | last post by:
I am having a problem with my Datagrid that displays my Files via GetFiles() If I use a HyperLinkColumn - I can use the column name "Name" which is what the result from GetFiles(). ******************************************************** Sub GetFileList() Dim dirInfo as DirectoryInfo = new DirectoryInfo(Server.MapPath("/uploads/"))
0
9721
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10640
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
10376
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
10120
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
9200
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
7662
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...
1
4332
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3861
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3015
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.