473,403 Members | 2,284 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,403 software developers and data experts.

Converting a column in a grid to link

Hi I want to convert a column to a link. All examples I
have seen works with bound columns. I have the following
grid:
<asp:datagrid runat="server" id="__theDetailsGrid"
cellpadding="2" cellspacing="0"
OnItemDataBound="Details_Item_Bound">
</asp:datagrid>

It is bound during runtime to a DataTable that is bound to
a SqlDataAdapter. The Details_Item_Bound function changes
the background color based on a value. I have been able to
get that to work with the following code:

private void Details_Item_Bound(object sender,
DataGridItemEventArgs e)
{
if((e.Item.ItemType == ListItemType.Item) ||
(e.Item.ItemType == ListItemType.AlternatingItem))
{
if(e.Item.Cells[1].Text == "FAILED")
{
foreach(TableCell c in e.Item.Cells)
{
c.BackColor = System.Drawing.Color.Red;
}
}
}
}
}

Basically what I would like to do is to set the text in
column number 3 to a hypertext link that will point to
another page if the value is "FAILED" in column 1
Hope you guys understand what I would like to acomplish.
Nov 17 '05 #1
0 936

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

Similar topics

4
by: John Doe | last post by:
Hi I want to convert a column to a link. All examples I have seen works with bound columns. I have the following grid: <asp:datagrid runat="server" id="__theDetailsGrid" cellpadding="2"...
2
by: Jason | last post by:
I have a data grid with a hyperlink column. The hyperlink is created by a class that extracts the link from an XML Document. How can I populate the hyperlink column in the data grid with the...
10
by: JohnR | last post by:
I have a datatable as the datasource to a datagrid. The datagrid has a datagridtablestyle defined. I use the datagridtablestyle to change the order of the columns (so they can be different than...
6
by: GK | last post by:
I have an ASP.NET web application (version 1.1,VS 2003), running on Windows XP Professional, SP2. Many of the pages use ASP.NET Grid Control, with pagination. One of the columns of this Grid is a...
2
by: Remy | last post by:
Hi I would like to put a link into the Footer of the first column of an ASP.NET 2.0 GridView. By first column I mean the column where it normally displayes the Edit and Delete link. I've built...
2
by: Smokey Grindle | last post by:
I have the following on my page... a link button that will send the command name "use" to the command handler and a grid view with the following columns 0 - Template column - just a checkbox...
5
by: BenG | last post by:
Hi. I have a gridview control on a web form (asp.net 2.0) that's bound to a objectDataSource. The objectdatasource which is bound to a class I've written in the DAL to read and update the database....
1
by: =?Utf-8?B?UmFodnlu?= | last post by:
Hi All; I'm working in VS2005, and have a DataGridView that is bound to a datasource. Is there a way to change a column to be a link style column after the DataGridView populates? Here's how I...
2
by: Valli | last post by:
Hi, I am using a gridview to display data from table. In the gridview, there are 5 columns in which one column contains link name(eg. http://www.msn.com). I want to show this link as an...
1
by: rogerford | last post by:
I have a grid which i bind with values from Database. I have events to edit and update the grid. I am not using SqlDatasource to connect to DB. Rather i am doing the updating of the grid...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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
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...

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.