adding a HyperLinkField programmatically question
ASP.NET
1
Posts
1
Posters
0
Views
1
Watching
-
Hi, I am adding fields to my grid view on the fly but when i try to define the DataNavigateUrlFields = "pid" i have this error Value of type 'String' cannot be converted to '1-dimensional array of String'. here is the code, how can i fix that
SqlDataSource1.SelectCommand = "SELECT * FROM [products]" Dim lnk As HyperLinkField lnk = New HyperLinkField lnk.DataTextField = "pname" lnk.NavigateUrl = "home.aspx" lnk.DataNavigateUrlFields = "pid" lnk.DataNavigateUrlFormatString = "~/home.aspx?pid={0}" Dim bFld As BoundField = Nothing bFld = New BoundField() bFld.DataField = "pid" GridView1.Columns.Add(bFld) GridView1.Columns.Add(lnk)
any help