[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Datagrid View Contents Format Control and Event Handling

Posted on 2012-04-01
2
Medium Priority
?
280 Views
Last Modified: 2012-04-02
Hi

I have the following VB.NET code to populate a gridview (in a windows application form):

        Dim NotfData As New DataSet
        NotfData = MC.DB(NoftDataSQL()) 'this will populate "NotfData.Tables(0)" with Data

        Notf_Grid.Columns.Add("NotfCount", "No.")
        Notf_Grid.Columns.Add("NotfLink", "Notification Link")
        Notf_Grid.Columns.Add("NotfID", "Notification ID")

        For i = 0 To NotfData.Tables(0).Rows.Count - 1
            Notf_Grid.Rows.Add((i + 1).ToString, NotfData.Tables(0).Rows(i).Item("Notf. Link"), NotfData.Tables(0).Rows(i).Item("Notf. ID"))
        Next

        Notf_Grid.Columns(0).AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells
        Notf_Grid.Columns(1).AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells
        Notf_Grid.Columns(2).Visible = False

Open in new window


I have three questions:

Question 1: How can I make Notf_Grid.Columns(1) formats its rows values into Hyperlinks instead of pure text?

Question 2: How can I add an (OnClick) event handler for each row/cell of this [Notf_Grid]?

Question 3: How can I format the text (bold, italic, underline ... etc.) of any cell in this [Notf_Grid]
0
Comment
Question by:alfardan
[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 20

Accepted Solution

by:
BuggyCoder earned 1500 total points
ID: 37794899
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 37795286
1) Check the AddLinkColumn method in below example
    http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridviewcomboboxcolumn%28VS.90%29.aspx#Y700

2) Handle the CellClick and SelectionChanged events

3) Use the CellFormatting event
    http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview.cellformatting.aspx
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

649 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