Results 1 to 2 of 2

Thread: [2008] Writing GridView with HyperLinkField to CSV

  1. #1

    Thread Starter
    Registered User nmadd's Avatar
    Join Date
    Jun 2007
    Location
    U.S.A.
    Posts
    1,676

    [2008] Writing GridView with HyperLinkField to CSV

    Howdy,
    I'm fine with writing a GridView to a CSV file as long as there is not a HyperLinkField in my GridView. When trying to export a GridView with HyperLinkFields to a CSV, however, my HyperLinkFields simply appear blank in my CSV. I'm writing the CSV rows as such:
    vb.net Code:
    1. For i As Integer = 0 To gv.Rows.Count - 1 Step 1
    2.     For j As Integer = 0 To gv.Columns.Count - 1 Step 1
    3.         sw.Write("""" & gv.Rows(i).Cells(j).Text & """")
    4.  
    5.         If j < gv.Columns.Count - 1 Then
    6.             sw.Write(",")
    7.         End If
    8.     Next j
    9.  
    10.     sw.WriteLine()
    11. Next i
    When I come upon a HyperLinkField cell, what property am I looking for that will write the text to the CSV? Can you give me a push in the right direction?

    Thanks!

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: [2008] Writing GridView with HyperLinkField to CSV

    What is the gridview's data source, and why not write that to a csv file?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width