Link to home
Start Free TrialLog in
Avatar of LeeHopkins
LeeHopkinsFlag for United States of America

asked on

problem with dynamic created hyperlink datanavigaturlfields assigning value

I am creating hyperlink col at runtime in my gridview. but I cant get the datanavigateurlfields ="somefield" to work
keep getting error unambe to convert string to 1 dim array string
 Dim h_Column As New HyperLinkField
 h_Column = New HyperLinkField
 h_Column.HeaderText = COLName
 h_Column.DataNavigateUrlFields = "someval"
h_Column.NavigateUrl = "Supplier_OTD_Details.aspx"
gv1.Columns.Add(h_Column)
Avatar of Emad Gawai
Emad Gawai
Flag of United Arab Emirates image

Dim h_Column As New HyperLinkField
 h_Column = New HyperLinkField

seems wrong, repeated
remove
h_Column = New HyperLinkField
How is this column "DataNavigateUrlFields" defined?

Jim
Avatar of LeeHopkins

ASKER

I found the answer.
i needed to define my fields an array then assign the field value and it works
Dim fields() As String = {"Supplier_Score_Card"}
                            h_Column = New HyperLinkField
                            h_Column.DataTextField = COLName
                            h_Column.HeaderText = COLName
                            h_Column.DataNavigateUrlFields = fields
                            h_Column.DataNavigateUrlFormatString = "supplier_OTD_Details.aspx?ven={0}&rpttype=NCR&datev=" & currDate
                            h_Column.NavigateUrl = "Supplier_NCR_Details.aspx?ven={0}&rpttype=NCR&date=" & currDate
                            h_Column.Target = "_new"
                            gv1.Columns.Add(h_Column)
if any of us has helped u for that solution, award them else ask for delete and refund
ASKER CERTIFIED SOLUTION
Avatar of Computer101
Computer101
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial