|
-
Feb 26th, 2013, 05:54 AM
#1
Thread Starter
Hyperactive Member
List of websites + hyperlinks
I am in need of advice. I have a list of domains and I wanted to find out what the best course of method was to display this so the user can see the link and click on it. I have roughly 300_ domains so doing the link label is out of the question.
I wanted to create some sort of grid but then wondered if I was able to have hyperlinks in the grid, I didnt want to do an xml cos I didnt want any files outside of the main application and wanted everything internal.
Can anyone post some suggestions please.
Thank you.
-
Feb 26th, 2013, 07:37 AM
#2
Re: List of websites + hyperlinks
The DataGridView has a standard column type specifically for displaying hyperlinks.
-
Feb 26th, 2013, 09:31 AM
#3
Thread Starter
Hyperactive Member
Re: List of websites + hyperlinks
I currently have a datagrid set up but the links are in a XML file which is annoying when I want to bundle it. The current grid has 3 columns, name, name, website, but the link is like a text link and not clickable, is there an easy way for me to contain the links in the XML to within the application so the data displayed in the 3rd column has a clickable hyperlink?
Here is my code for grabbing the XML
Code:
Imports System.Xml
Imports System.Data
Public Class Form1
Dim ds As New DataSet
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim xmlFile As XmlReader
xmlFile = XmlReader.Create("C:\Projects\PhoneData.xml", New XmlReaderSettings())
ds.ReadXml(xmlFile)
DataGridView1.DataSource = ds.Tables(0)
End Sub
Private Sub btnMobileDeviceFilter_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnMobileDeviceFilter.Click
ds.Tables(0).DefaultView.RowFilter = "[Mobile_Phone_Type] like '%" & tbMobileDevice.Text & "%'"
DataGridView1.DataSource = ds.Tables(0)
End Sub
Private Sub btnSimType_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSimType.Click
ds.Tables(0).DefaultView.RowFilter = "[SIM_Type] like '%" & tbSIMType.Text & "%'"
DataGridView1.DataSource = ds.Tables(0)
End Sub
Private Sub btnWebsiteLinkFilter_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnWebsiteLinkFilter.Click
ds.Tables(0).DefaultView.RowFilter = "[Website_Link] like '%" & tbWebsiteLink.Text & "%'"
DataGridView1.DataSource = ds.Tables(0)
End Sub
-
Feb 26th, 2013, 07:04 PM
#4
Re: List of websites + hyperlinks
As I said, the DataGridView (NOT DataGrid, which is a different control) has a standard column type specifically for hyperlinks. It's not going to add one by default though, because it has no idea that the text in that column is supposed to be links. If you want a link column then you have to add one yourself, which you would do in the designer. You can add just that column and let the grid add the others or you can add all the columns yourself. I'd probably go with the second option. If you add columns in the designer then you must set their DataPropertyName so they know what to bind to.
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
|