Solved

VB2010:  How to modify text in a datagridview.

Posted on 2010-08-27
2
1,253 Views
Last Modified: 2013-11-27
I imported data into my DataGridView in my Visual Basic 2010 Windows application.  The table looks like this:
router-1   10.20.21.145  KC
router-2   10.20.21.146  St. Louis
router-3   10.20.21.147  Columbia

Now I want to:
1.) convert the ip addresses into hyperlinks pointing to the same address,
2.) create an "on_click" event for the city names, and
3.) modify the "router-x" text.

I know it's a lot to ask, and a tutorial would be useful, but I haven't found what I need yet.  Any help will be appreciated.  This is the my first time using a datagridview.
Imports System.Data
Public Class Form1
    Private Sub Button1_Click(ByVal sender As System.Object, _
                ByVal e As System.EventArgs) Handles Button1.Click
        Try
            Dim MyConnection As System.Data.OleDb.OleDbConnection
            Dim DtSet As System.Data.DataSet
            Dim MyCommand As System.Data.OleDb.OleDbDataAdapter
            MyConnection = New System.Data.OleDb.OleDbConnection _
            ("provider=Microsoft.Jet.OLEDB.4.0;" & _
            " Data Source='c:\testfile.xls'; " & _
             "Extended Properties=Excel 8.0;")
            MyCommand = New System.Data.OleDb.OleDbDataAdapter _
                ("select * from [ Vlan - 32$]", MyConnection)
            MyCommand.TableMappings.Add("Table", "TestTable")
            DtSet = New System.Data.DataSet
            MyCommand.Fill(DtSet)
            DataGridView1.DataSource = DtSet.Tables(0)
            MyConnection.Close()
        Catch ex As Exception
            MsgBox(ex.ToString)
        End Try
    End Sub
End Class

Open in new window

0
Comment
Question by:motokent
2 Comments
 
LVL 96

Accepted Solution

by:
Bob Learned earned 500 total points
ID: 33548998
The first thing that you need to know about is the DataGridViewLinkColumn type:

DataGridViewLinkColumn Class
http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridviewlinkcolumn.aspx
0
 
LVL 18

Expert Comment

by:John (Yiannis) Toutountzoglou
ID: 33549495
About your First Question the answer is already given Form LearnOne...
About the second and third part of your question
Click Event ......What Exactly do you need
....and Modify text.....Also what do you wnat....
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question