Advertisement
Guest User

Untitled

a guest
Dec 12th, 2018
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. Public Class Form1
  2. Protected Overrides Sub OnLoad(e As EventArgs)
  3. MyBase.OnLoad(e)
  4.  
  5. Dim entites = New List(Of Entite) From {New Entite With {.Nom = "william "}, New Employe With {.Nom = "John doe"}}
  6.  
  7. DataGridView1.DataSource = entites.Select(Function(x) New With {.nom = x.Nom, .type = If(TypeOf (x) Is Employe, "Employe", "Entite")}).ToList
  8. End Sub
  9. End Class
  10.  
  11. Public Class Entite
  12. Public Property Nom As String
  13.  
  14. End Class
  15.  
  16. Public Class Employe
  17. Inherits Entite
  18.  
  19. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement