Solved

Puting Extra Items Into Gridview Along With Databinding

Posted on 2011-03-25
3
189 Views
Last Modified: 2012-05-11
This is actually two questions.  

First, I am trying to convert an result from a query into a hyperlink that will lead to an image path on our servers.  So, I get the path from the query, then how can I convert it to a hyperlink for Gridview to display?

Second say you have query results that you want to put into a Gridview from a datatable like this:

        Dim dtFinalResults As DataTable = Session("Result_Data")
        GridView1.DataSource = dtFinalResults
        GridView1.DataBind()

Open in new window


But lets say in addition to that you want to add something else to each row.  Say a preview image or a button how would you do that?
0
Comment
Question by:DPottsLM
3 Comments
 
LVL 7

Accepted Solution

by:
nbove earned 250 total points
ID: 35219407
1)  Look into using a hyperlink field.  The following page describes how to use a hyperlink field in a gridview:
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.hyperlinkfield.aspx

2)  You are probably going to have to modify each row on the RowDataBound event.  The following page describes how to use the RowDataBound event in a gridview:
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.rowdatabound.aspx
0
 
LVL 19

Expert Comment

by:Amandeep Singh Bhullar
ID: 37230468
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question