Thursday, January 5, 2017

view PDF document on a cell click on datagridview - visual studio 2015

//first of all load pdf reader from toolbox->addtab->choose items->com components

 Private Sub DataGridView1_CellContentClick(sender As Object, e As DataGridViewCellEventArgs) Handles DataGridView1.CellContentClick
       
        Dim ofd As New OpenFileDialog
        ofd.Filter = "PDF| *.pdf"
        ofd.FileName = "z:\process\documents\" & DataGridView1.CurrentRow.Cells(1).Value 
         Me.AxAcroPDF1.LoadFile(ofd.FileName)
    End Sub


No comments: