473,804 Members | 3,031 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

HyperLinkColumn in a DataGrid

Hello,

I have a HyperLinkColumn in a DataGrid found in a Summary page.

When the link is clicked on, I want to get the data for all fields in the
database for that record and display this data on a Details page that does
not display the data in a DataGrid but instead displays it in a series of
databound label controls.

Is this possible or do I need to display the data on my Details page in a
DataGrid?

Thanks for any pointers.

-glenn
Jun 13 '06 #1
2 1397
This is very possible. You need to provide the ID for each row to the
hyperlink. You can do this in the onItemDataBound event of your
datagrid, using the FindControl() function to get the link for each
row, and then add a querystring parameter to the link. You could also
do this in the HTML view, by modifying the DataBinder.Eval syntax.

Then on your destinatino page, just grab the querystring parameter, and
display whatever data you want.

the alternative would be to use something like a LinkButton, and then
either redirect as above, or also you could stay on the same page, but
hide the datagrid and show your labels.
glenn wrote:
Hello,

I have a HyperLinkColumn in a DataGrid found in a Summary page.

When the link is clicked on, I want to get the data for all fields in the
database for that record and display this data on a Details page that does
not display the data in a DataGrid but instead displays it in a series of
databound label controls.

Is this possible or do I need to display the data on my Details page in a
DataGrid?

Thanks for any pointers.

-glenn


Jun 13 '06 #2
Jason,

Could you point me to any sample code that might illustrate how to do what
you have described?

-Glenn

"Jason Coyne" wrote:
This is very possible. You need to provide the ID for each row to the
hyperlink. You can do this in the onItemDataBound event of your
datagrid, using the FindControl() function to get the link for each
row, and then add a querystring parameter to the link. You could also
do this in the HTML view, by modifying the DataBinder.Eval syntax.

Then on your destinatino page, just grab the querystring parameter, and
display whatever data you want.

the alternative would be to use something like a LinkButton, and then
either redirect as above, or also you could stay on the same page, but
hide the datagrid and show your labels.
glenn wrote:
Hello,

I have a HyperLinkColumn in a DataGrid found in a Summary page.

When the link is clicked on, I want to get the data for all fields in the
database for that record and display this data on a Details page that does
not display the data in a DataGrid but instead displays it in a series of
databound label controls.

Is this possible or do I need to display the data on my Details page in a
DataGrid?

Thanks for any pointers.

-glenn


Jun 13 '06 #3

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" />
3
3380
by: SStory | last post by:
I have a style sheet for my site. It has various classes in it. It has <A: styles defined for all anchor tags. I have a datagrid in ASP.NET with a stylesheet linked to the page. It defines links a yellow which is what I normally won't but in this case I want to override the link color and can't seem to do it. I set the forecolor in itemstyle prop. But it doesn't work.
3
1228
by: Morten | last post by:
Hi. After a while I finaly discovered how to use HyperLinkColumns. What I can't find is how to send mote than one "value" like page.aspx?id1&id2!!! <asp:HyperLinkColumn DataNavigateUrlField="InvoNo" DataNavigateUrlFormatString="Invo.aspx?Id={0}" DataTextField="InvoNo" HeaderText="Invo No."> <HeaderStyle HorizontalAlign="Left"></HeaderStyle>
0
1088
by: Atif Jalal | last post by:
I am using a Datagrid control and one of its column is a 'HyperLinkColumn'. The link text for this HyperLinkColumn is sometimes beyond 100 characters. I would like to display the link on multi-line if the number of characters in the link exceed 100 characters. I tried adding the <ItemStyle> to the HyperLinkColumn tag but it did not work, the whole of the link is displayed on one line with the column width getting extended. ...
1
1970
by: Dave | last post by:
I have a hyperlink column in a datagrid as follows <asp:HyperLinkColumn DataNavigateUrlField="OrderId" DataNavigateUrlFormatString="OrderDetails.aspx?Id={0}" DataTextField="Order" HeaderText="Order" ItemStyle-CssClass="Green10pt"></asp:HyperLinkColumn renders ... <td class="Green10pt"><a href=OrderDetails.aspx?Id=398365">ABC Corp</a></td>.. How can I get the class to be added to the anchor <a> tag not in the outer <td> element? ...
1
1421
by: Rob Meade | last post by:
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
10
1759
by: tshad | last post by:
I have a Datagrid with a column: <asp:HyperLinkColumn DataTextField="JobTitle" DataNavigateUrlField="PositionID" DataNavigateUrlFormatString="AddNewPositions.aspx?PositionID={0}" HeaderText="Job Title" Visible="True" SortExpression="JobTitle"/>
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...
1
1472
by: Craig | last post by:
I have a datagrid with a couple of columns. Right now, I'm setting assigning the dataview to the datasource. For the HyperLinkColumn.... <asp:HyperLinkColumn DataNavigateUrlField="ATTACHMENTDOWNLOADURL" Text="Download" HeaderText="Quick Links" SortExpression="FILEPATH"/> The field in the dataview is something like: "/mypath/tomyfile/hello.txt" the link gets set to http://localhost/mypath/tomyfile/hello.txt" I want the base of the...
4
2254
by: rcoco | last post by:
Hi all, I have this big problem with hyperlinks I would appriciate any help please. My web site has two datagrids on the same page. And one has a list of names of the users which are in a HyperlinkColumn. The second datagrid is for inserting data, and when a user inserts data I used 'Windows Authentication' for names in one column called Name. Now this is how it's supposed to work: When any user want to see data about a particular user...
0
9579
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
10571
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...
1
10317
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10075
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...
1
7615
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
6851
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5520
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...
1
4295
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
3815
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.