473,396 Members | 1,779 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Datagrids and hyperlinks to more data.

Hello,

I am using a flat file database that has been imported to SQL Server
2000. So it is a DB with one table.

What I want to do is display 3 of the 30 fields on an .aspx screen.
One of the 3 fields would have a hyperlink. Upon clicking that
hyperlink the remaining 27 fields of that particular record would be
displayed - so more detail per record can be displayed.

Right now - I have created a datagrid that is populated by an sql
statement which pulls the 3 fields in.

What is the best way to put in the hyperlink on a field? Then the
code to display more data?

For example (name would would have the hyperlink designated by the
'---')

Right now it would show this:
Name Address Sex

Dave House M
----
Ben Apt M
---
Sue House F
---

On clicking the ---- by Dave it would reveal:

Name Address Sex Phone Cable Utilties Washer Stove Furnished
Price ...(20 more fields)

Dave House M 555555 $10 Electric Maytag Gas Partly
$1000 ... (20 more fields shown)
Suggestions on how to get started?
Tutorial, code example or website?

Thanks,

Tmuld

Nov 21 '05 #1
1 910
Hi,

Why don't you create a page called, say, "details.aspx". Then add a
HyperlinkColumn to your data grid and set the
"DataNavigateUrlFormatString" attribute to "details.aspx?id={0}" and
also set the DataNavigateUrlField attribute to "fldID", or whatever your
primary key field is.

So it'll look something like this:

---
<asp:HyperlinkColumn
HeaderText="More Details"
DataNavigateUrlField="fldID"
DataNavigateUrlFormatString="details.aspx?id={0}"
Text="Show Details" />
---

It might be worth having a look at the HyperlinkColumn class in the
framework documentation and getting familiar with it's properties.

Then, in details.aspx you would display all of the information for the
user ID passed in the URL. You can get the ID variable from the url by
accessing the Request.QueryString collection.

That's how I would do it personally.

Regards,
-Adam.

Tmuld wrote:
Hello,

I am using a flat file database that has been imported to SQL Server
2000. So it is a DB with one table.

What I want to do is display 3 of the 30 fields on an .aspx screen.
One of the 3 fields would have a hyperlink. Upon clicking that
hyperlink the remaining 27 fields of that particular record would be
displayed - so more detail per record can be displayed.

Right now - I have created a datagrid that is populated by an sql
statement which pulls the 3 fields in.

What is the best way to put in the hyperlink on a field? Then the
code to display more data?

For example (name would would have the hyperlink designated by the
'---')

Right now it would show this:
Name Address Sex

Dave House M
----
Ben Apt M
---
Sue House F
---

On clicking the ---- by Dave it would reveal:

Name Address Sex Phone Cable Utilties Washer Stove Furnished
Price ...(20 more fields)

Dave House M 555555 $10 Electric Maytag Gas Partly
$1000 ... (20 more fields shown)
Suggestions on how to get started?
Tutorial, code example or website?

Thanks,

Tmuld

Nov 21 '05 #2

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

Similar topics

1
by: Simon Harris | last post by:
Hi All, I wish to populate more than one datagrid from the same OleDBCommand. The code I have is: Dim objCmd As New OleDbCommand(strSql, objConn) Then... ...
1
by: keys4worship | last post by:
Here goes... I am very new to programming. I am currenting using Visual Studio C# to connect to SQL db. The db has only one table and two views. I have created 3 datagrids on one page along with 3...
1
by: ree32 | last post by:
I have a placeholder and depending on a user input(a drop downlist) when the user clicks a button I dynamically create a number of datagrids and fill them with data from a database. But the problem...
4
by: dan.benge | last post by:
Hi there, I have to build an ASP report that has a one-to-many relationship in it. For each row of data, there will be a comment column that can have many comments. I will only display about...
1
by: Tarren | last post by:
Hi: I am new to using datagrids in winforms. How do I modify the parameters of the individual columns in the datagrids. I do not see anything akin to a Columns collection in the datagrid...
4
by: mark | last post by:
(windows app not web) I have a procedure to populate a given datagrid (Datagrid1) with a dataset from an indexed data connection. It works: Globals: Dim FileName1 As String Dim DS As...
3
by: Mark Wiewel | last post by:
hi all, i am a newbie in ASP.NET and i couldn't find the solution to this one: i have a form with three datagrids on it. i would like to align them vertically with a space between each grid of...
1
by: jez123456 | last post by:
Hi Experts I have a working c# application that users can store files (.doc, .xls, ..bmp, etc) as binary data into an Access database. I now need to extend this to also store hyperlinks. ...
1
by: Janna | last post by:
Hello tech savvy gurus! I hope someone can help me! THE PROBLEM: "Cannot open specified file" when I click on a hyperlink in an Access database when it is located on our server. THE...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
0
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,...
0
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...
0
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...
0
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...
0
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,...

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.