Solved

Puting Extra Items Into Gridview Along With Databinding

Posted on 2011-03-25
3
188 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
Delivering innovative fully-managed cloud services for mission-critical applications requires expertise in multiple areas plus vision and commitment. Meet a few of the people behind the quality services of Concerto.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

919 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now