Solved

Datagridview and generic list

Posted on 2007-11-19
1
688 Views
Last Modified: 2008-02-01
My task class exposes a developer object
    Public Property Developer() As Developer
        Get
            Return mDeveloper
        End Get
        Set(ByVal value As Developer)
            mDeveloper = value
        End Set
    End Property


How can I access this while binding?

This is what I have tried and it does not display the full name.

dgvTasks.AutoGenerateColumns = False

Dim list As New List(Of Task)
Dim task As New Task()
list = task.GetTasks(projectID)

dgvTasks.DataSource = list
dgvTasks.Columns.Add("Description", "Description")
dgvTasks.Columns.Add("FullName", "Developer")

dgvTasks.Columns(0).DataPropertyName = "Description"
dgvTasks.Columns(1).DataPropertyName = "Developer.FullName"
0
Comment
Question by:JRockFL
1 Comment
 
LVL 18

Accepted Solution

by:
jcoehoorn earned 500 total points
ID: 20315214
Public Readonly Property DeveloperName() As String
        Get
            Return mDeveloper.FullName
        End Get
End Property

'...

dgvTasks.Columns(1).DataPropertyName = "DeveloperName"
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
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…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

760 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now