Solved

Puting Extra Items Into Gridview Along With Databinding

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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

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…
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

760 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

24 Experts available now in Live!

Get 1:1 Help Now