471,354 Members | 1,482 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,354 software developers and data experts.

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 1058

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by pargat.singh | last post: by
8 posts views Thread by =?Utf-8?B?TWlrZSBSYW5k?= | last post: by
reply views Thread by =?Utf-8?B?RGFu?= | last post: by
reply views Thread by XIAOLAOHU | last post: by

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.