|
-
Feb 5th, 2009, 05:17 AM
#1
Thread Starter
Fanatic Member
-
Feb 5th, 2009, 06:01 AM
#2
Re: Link in datagrid did not responce..
Please mark you thread resolved using the Thread Tools as shown
-
Feb 5th, 2009, 06:06 AM
#3
Re: Link in datagrid did not responce..
And one WebBrowser Control in your form and
Code:
Private Sub DataGridView2_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView2.CellContentClick
Dim sUrl As String = DataGridView2.Rows(e.RowIndex).Cells(e.ColumnIndex).Value.ToString
WebBrowser1.Navigate(sUrl)
End Sub
You could check for the valid link before navigating to them
Please mark you thread resolved using the Thread Tools as shown
-
Feb 5th, 2009, 07:25 PM
#4
Thread Starter
Fanatic Member
Re: Link in datagrid did not responce..
what if it's not a web browser found on that cell.. what if it's path of the file from the server..? exam the cell contains \\pc1\data\group1\lectures
how to make when i click the cell the path inside the cell well open..
-
Feb 5th, 2009, 08:33 PM
#5
Thread Starter
Fanatic Member
Re: Link in datagrid did not responce..
nothing happen i tried to do this codes below..
Code:
Private Function IsANonHeaderLinkCell(ByVal cellEvent As _
DataGridViewCellEventArgs) As Boolean
If TypeOf DataGridView1.Columns(cellEvent.ColumnIndex) _
Is DataGridViewLinkColumn _
AndAlso Not cellEvent.RowIndex = -1 Then _
Return True Else Return False
End Function
Private Function IsANonHeaderButtonCell(ByVal cellEvent As _
DataGridViewCellEventArgs) As Boolean
If TypeOf DataGridView1.Columns(cellEvent.ColumnIndex) _
Is DataGridViewButtonColumn _
AndAlso Not cellEvent.RowIndex = -1 Then _
Return True Else Return (False)
End Function
Public Event CellContentClick As DataGridViewCellEventHandler
Private Sub DataGridView2_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView2.CellContentClick
If IsANonHeaderLinkCell(e) Then
MoveToLinked(e)
End If
End Sub
Please help
-
Feb 5th, 2009, 09:48 PM
#6
Thread Starter
Fanatic Member
Re: Link in datagrid did not responce..
please help i think i don't understand what it mean in the code above.. please help... how to do when i click the cell it run the path found in the cell.. please help..
ex. when the linkcolumn cell has C:\Program Files\
when i click the cell it will open the C:\Program Files folder
Last edited by edgarbenilde; Feb 5th, 2009 at 10:07 PM.
-
Feb 5th, 2009, 11:27 PM
#7
Re: Link in datagrid did not responce..
For Opening a Physical Folder you have to Use Process.Start Method.
Code:
Private Sub DataGridView2_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView2.CellContentClick
Dim sUrl As String = DataGridView2.Rows(e.RowIndex).Cells(e.ColumnIndex).Value.ToString
Process.Start(sUrl)
End Sub
Hope this helps
Please mark you thread resolved using the Thread Tools as shown
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|