Solved

VB2010:  How to modify text in a datagridview.

Posted on 2010-08-27
2
1,263 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

705 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