Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 2005 > C# 2005
|
C# 2005 For discussion of Visual C# 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# 2005 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 9th, 2006, 07:10 AM
Authorized User
 
Join Date: Jul 2005
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default How could i store a link in a DataRow in VC# 2005?

Hello all,

In VC# 2005, I want to store a link to a page say Edit.aspx on a DataRow object and i used

the following code:

protected void Page_Load(object sender, EventArgs e)
{
DataTable dtbl = new DataTable();

DataColumn dcol = new DataColumn("LINK");

dtbl.Columns.Add(dcol);

DataRow dRow;

dRow = dtbl.NewRow();

dRow[0]= "<a href = '../EventsCalendar/Edit.aspx '>" + "Edit" + "</a>";

dtbl.Rows.Add(dRow);

grdvw.DataSource = dtbl;
grdvw.DataBind();

}

There is a GridView Control also called grdvw where Iam binding my DataTable object Called

dtbl to this GridView Control.The code is,

grdvw.DataSource = dtbl;
grdvw.DataBind();

Now the problem with this code is the variable dRow[0] is storing the whole string in place

of storing only Edit as hyperlink.

I mean to say dRow[0] == "<a href = '../EventsCalendar/Edit.aspx '>" + Edit + "</a>";

Due to this problem Iam not getting the Edit link on my Gridview 0th Column cell. Instead of

Edit link Iam getting the whole string which is <a href = '../EventsCalendar/Edit.aspx

'>Edit</a>.

It seems that html tags <a>, and single and double quotes are not recognised by this program.

But when I used DataGrid Control I got the proper output. Why this problem is happening with the GridView control only? Can anyone tell me.

CAN ANYONE HELP ME OUT to get the desired result on my Gridview control?

Waiting for your early response.
Please Do reply very soon. Iam in need of urgent help!!!!





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to move the mouse in VC++ 2005 marcelo39 Visual C++ 0 April 25th, 2008 09:36 AM
my problem with vc++2005 Anahita Visual C++ 2005 0 March 27th, 2007 09:22 AM
Please, need help with VC 2005 express IDE! pghTech Visual C++ 2005 0 June 27th, 2006 06:40 PM
How could i store a link in a DataRow in VC# 2005? Lalit Pradhan ASP.NET 2.0 Professional 10 June 20th, 2006 12:50 PM
vc++2003 can't link properly. Kilka Visual C++ 1 March 15th, 2005 06:43 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.