Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Datagridview and generic list

Posted on 2007-11-19
1
Medium Priority
?
702 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:
Joel Coehoorn earned 2000 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

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

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

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
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…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Loops Section Overview
Suggested Courses
Course of the Month12 days, 19 hours left to enroll

971 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