rhonda2010 0 Newbie Poster

Hi! I am having trouble creating a hyperlink in my datagrid. What I need is to make two columns in the datagrid hyperlinks. For example, one column in the datagrid is for a report number. Another column is the path for pictures. So, I want the user to be able to click on the report number and link to a new page with the report information. Same with the picture, click on the link and have the pictures appear. I know the pictures may be a little more difficult; however, I cannot get the report link to work. I tried to add a: .Columns(18).ReadOnly = False, but I still get the error message: "Proerty 'Item' is "ReadOnly'". I don't want the user to be able to change any data on the grid; however, I do need to be able to add a hyperlink.

Any suggestions?

Thanks!

    da2 = New OleDb.OleDbDataAdapter(strSelect, con)

    da2.Fill(ds2, "GridData")

    Dim intColCount As Integer

    If ds2.Tables(0).Rows.Count > 0 Then

        lblNoData.Visible = False

        intColCount = ds2.Tables(0).Columns.Count

        With DataGridView2

            .Visible = True

            .DataSource = ds2.Tables(0)


            For i = 0 To intColCount - 1
                .Columns(i).ReadOnly = True
            Next

        End With

    Else

        lblNoData.Visible = True
        DataGridView2.Visible = False


    End If
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.