Click here to Skip to main content
15,887,214 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Pause application Pin
Colin Angus Mackay17-Mar-09 1:02
Colin Angus Mackay17-Mar-09 1:02 
AnswerRe: Pause application Pin
Eddy Vluggen17-Mar-09 1:06
professionalEddy Vluggen17-Mar-09 1:06 
GeneralRe: Pause application Pin
Colin Angus Mackay17-Mar-09 3:15
Colin Angus Mackay17-Mar-09 3:15 
GeneralRe: Pause application Pin
Eddy Vluggen17-Mar-09 4:05
professionalEddy Vluggen17-Mar-09 4:05 
GeneralRe: Pause application Pin
Dave Kreskowiak18-Mar-09 5:43
mveDave Kreskowiak18-Mar-09 5:43 
GeneralRe: Pause application Pin
Eddy Vluggen18-Mar-09 6:06
professionalEddy Vluggen18-Mar-09 6:06 
AnswerRe: Pause application Pin
Jay Royall17-Mar-09 3:23
Jay Royall17-Mar-09 3:23 
QuestionVB.net datagridview with a HyperLinkColumn that doesnt work Pin
AndyWhite00717-Mar-09 0:13
AndyWhite00717-Mar-09 0:13 
Hello

Language VB.net Visual Studio 2005

This sounds like it's should be simple, but I've been working on it all night with no joy. Basically, I need to create a DataGridView on the fly and it will contain a column of various website addresses. However, if I use a HyperLinkColumn then I cant get the cells to contain the URLs. Either all the cells contain the same URL, or each cell contains the correct value - but there's no hyperlink. First top solve it get's a beer (as long as they're in Camden)

I've posted my project here: http://www.camdenconsultancyservice.co.uk/Test/Grrrrr.zip

I've pasted the code below ..... now I need to get some sleeeeeeeeeep.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Public Class Form1

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

'---adding columns---
DataGridView1.Columns.Add("ID", "Product ID")
DataGridView1.Columns.Add("Name", "Product Name")
DataGridView1.Columns.Add("Description", "Description")
DataGridView1.Columns.Add("Price", "Price")
'DataGridView1.Columns.Add("Website", "Website")

Dim HyperLinkColumn As New DataGridViewLinkColumn
Dim DataGridViewRow As New DataGridViewRow
With HyperLinkColumn
.Name = "WebsiteColumn"
.HeaderText = "Website"
'.DataPropertyName = "Website" 'this carries the values across
.UseColumnTextForLinkValue = True
'.ReadOnly = False
'.Visible = True
'.Text = "http://www.google.com"
End With
DataGridView1.Columns.Add(HyperLinkColumn)

For i As Integer = 0 To 4
'---create a row---
Dim item As New DataGridViewRow
item.CreateCells(DataGridView1)
With item
.Cells(0).Value = i
.Cells(1).Value = "Product " & i
.Cells(2).Value = "Description of Product " & i
.Cells(3).Value = "99.99"
'.Cells(4).Value = "http://www.evergreenhouse.co.uk" & i
'HyperLinkColumn.Index(i).Text = "http://www.google.co.uk" & i
'HyperLinkColumn.Index(i).Value = "http://www.google.co.uk" & i
HyperLinkColumn.Index
'MsgBox(.Cells(4).Value)
End With
'HyperLinkColumn.Text = "http://www.evergreenhouse.co.uk" & i
'---add the row---
DataGridView1.Rows.Add(item)
Next

End Sub

Private Sub DataGridView1_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellContentClick
If DataGridView1.Columns(e.ColumnIndex).GetType Is GetType(DataGridViewLinkColumn) Then
'Open document by Process.Start().
System.Diagnostics.Process.Start(DataGridView1(e.ColumnIndex, e.RowIndex).Value.ToString)
End If
End Sub

End Class
AnswerRe: VB.net datagridview with a HyperLinkColumn that doesnt work Pin
Dave Kreskowiak19-Mar-09 8:14
mveDave Kreskowiak19-Mar-09 8:14 
Questionhow to create a data report Pin
akosidandan16-Mar-09 23:57
akosidandan16-Mar-09 23:57 
AnswerRe: how to create a data report Pin
Eddy Vluggen17-Mar-09 0:03
professionalEddy Vluggen17-Mar-09 0:03 
AnswerRe: how to create a data report Pin
Steven J Jowett17-Mar-09 0:04
Steven J Jowett17-Mar-09 0:04 
QuestionRe: how to create a data report Pin
akosidandan17-Mar-09 1:43
akosidandan17-Mar-09 1:43 
AnswerRe: how to create a data report Pin
Steven J Jowett17-Mar-09 2:01
Steven J Jowett17-Mar-09 2:01 
QuestionRe: how to create a data report Pin
akosidandan17-Mar-09 2:15
akosidandan17-Mar-09 2:15 
AnswerRe: how to create a data report Pin
Anubhava Dimri17-Mar-09 19:10
Anubhava Dimri17-Mar-09 19:10 
Questioncannot get the value Pin
zaimah16-Mar-09 22:51
zaimah16-Mar-09 22:51 
AnswerRe: cannot get the value Pin
Christian Graus16-Mar-09 22:57
protectorChristian Graus16-Mar-09 22:57 
QuestionRe: cannot get the value Pin
zaimah17-Mar-09 17:35
zaimah17-Mar-09 17:35 
AnswerRe: cannot get the value Pin
Rupesh Kumar Swami16-Mar-09 23:19
Rupesh Kumar Swami16-Mar-09 23:19 
QuestionCustom properties Pin
udikantz16-Mar-09 22:08
udikantz16-Mar-09 22:08 
AnswerRe: Custom properties Pin
Dave Kreskowiak18-Mar-09 7:02
mveDave Kreskowiak18-Mar-09 7:02 
Questionfor each Pin
moonshaddow16-Mar-09 18:55
moonshaddow16-Mar-09 18:55 
AnswerRe: for each Pin
Christian Graus16-Mar-09 19:00
protectorChristian Graus16-Mar-09 19:00 
GeneralRe: for each Pin
moonshaddow16-Mar-09 19:04
moonshaddow16-Mar-09 19:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.