473,507 Members | 2,472 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Adding a HyperLinkField to a DatGrid

I am trying to add a HyperLinkField to a datagrid programatically, but
I keep running into the error:

"CS1502: The best overloaded method match for
'System.Web.UI.WebControls.DataGridColumnCollectio n.Add(System.Web.UI.WebControls.DataGridColumn)'
has some invalid arguments"

Here is my code

HyperLinkField column = new HyperLinkField();
column.DataNavigateUrlFields = strArray;
column.DataNavigateUrlFormatString = "edit.aspx?LogID={0}";
column.DataTextField = strArray[1];
column.DataTextFormatString = "{0}";
gridYear.Columns.Add(column);
gridYear.DataBind();
Can someone tell me what I am doing wrong?

Thank you!


Nov 19 '05 #1
0 1113

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

Similar topics

1
4043
by: pargat.singh | last post by:
I am using <asp:HyperLinkField in gridview as below which is working fine. <asp:HyperLinkField HeaderText="Process" Target="_blank" DataTextFormatString="Process me" DataTextField="doc_name" ...
2
17401
by: SP | last post by:
Hi, I need a GridView that when I click on a row or on a HyperLinkField a javascript call raise . It is possible? The grid is in a window open from a parent window. Onclick in a row selected,...
8
9645
by: =?Utf-8?B?TWlrZSBSYW5k?= | last post by:
I am trying to get a list of files from a specified directory using the System.IO namespace classes, and then use that list as the datasource for a GridView. I have been able to do this...
1
4343
by: JB | last post by:
I'm dynamically creating a Gridview object and filling it with contents from an ArrayList as follows: GridView2.AutoGenerateColumns = true; GridView2.DataSource = ArrayListObject;...
8
1909
by: robertoathome | last post by:
Hi all. Just when I thought I was finished I realized that my table, in the hyperlink field, doesn't have the base address in each link. E.g. I have: 040F-CY181824-MS.JPG where it should be...
8
11243
by: Jeff | last post by:
ASP.NET 2.0 I'm wondering how to set the color of a visited HyperLinkField (the link text) in a GridView?? Here is the markup of the HyperLinkField I have problems with: <asp:HyperLinkField...
1
11441
by: boevermann | last post by:
I prototyped an html table that has a hyperlink that pops a window showing a map of the entry from the that table. The link looks like this: <a href="authenticate.asp"...
0
1799
by: querry | last post by:
Hi all I have a requirement wherein I want to dynamically populate the GridView columns. I have figured out a way to do that. It is as follows SqlConnection con = new...
0
1816
by: =?Utf-8?B?RGFu?= | last post by:
I am creating the content for my Gridview through code. My last column is a hyperlinkfield. Everything is working fine except for applying my CssClass to the HyperLinkField. I have tried the...
0
7223
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7114
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
7377
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7034
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
7488
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...
1
5045
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...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1544
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
762
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.