Serializing a strong typed collection
-
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
-
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
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