J
John Smith
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.DataGridColumnCollection.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!
I keep running into the error:
"CS1502: The best overloaded method match for
'System.Web.UI.WebControls.DataGridColumnCollection.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!