Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Serializing a strong typed collection

Serializing a strong typed collection

Scheduled Pinned Locked Moved Visual Basic
helpdatabasedata-structuressales
2 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Jan Tielens
    wrote on last edited by
    #1

    Hi all, I've created a data carrier class, with some basic public properties. I've also created a strong typed collection for that class like this: _ Public Class CustomerCollection Inherits CollectionBase Public Default Property Item(index As Integer) As Customer Return MyBase.InnerList.Item(index) End Property 'Functionality to fill collection with customers... End Class This CustomerCollection-class is exposed by a webservice, like this: Public Function GetCustomers() As CustomerCollection Dim customers As New CustomerCollection Customers.Fill Return customers End Function The webservice works fine, I can reference it in another project and consume the data. But when I try to bind the returned array of Customers to a DataGrid, the DataGrid does not show the columns... Dim ws As New localhost.CustomerEngine DataGrid1.DataSource = ws.GetCustomers I can see how many rows/items the collection/array has, but there is not a single column that shows a property of the Customer class. I've searched for a solution for this problem, but I haven't found one. So I hope someone can help me with this one. Thanx, Jan

    J 1 Reply Last reply
    0
    • J Jan Tielens

      Hi all, I've created a data carrier class, with some basic public properties. I've also created a strong typed collection for that class like this: _ Public Class CustomerCollection Inherits CollectionBase Public Default Property Item(index As Integer) As Customer Return MyBase.InnerList.Item(index) End Property 'Functionality to fill collection with customers... End Class This CustomerCollection-class is exposed by a webservice, like this: Public Function GetCustomers() As CustomerCollection Dim customers As New CustomerCollection Customers.Fill Return customers End Function The webservice works fine, I can reference it in another project and consume the data. But when I try to bind the returned array of Customers to a DataGrid, the DataGrid does not show the columns... Dim ws As New localhost.CustomerEngine DataGrid1.DataSource = ws.GetCustomers I can see how many rows/items the collection/array has, but there is not a single column that shows a property of the Customer class. I've searched for a solution for this problem, but I haven't found one. So I hope someone can help me with this one. Thanx, Jan

      J Offline
      J Offline
      Jan Tielens
      wrote on last edited by
      #2

      Hi all I've created a solution for this problem, for who is intrested, you can find it here: http://www.codeproject.com/useritems/LeaditWebServiceWrapper.asp. Jan

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups