Re: Error: No default member found for type MyClass

From: Andy Eshtry (andyeshtry_at_hotmail.com)
Date: 02/15/04


Date: Sat, 14 Feb 2004 19:34:04 -0500

Thank you very much. Is there a sample code I can use to bind a user defined
collection to a
datagrid.
I used collection cause I want to assigned mulitple postal code to agents so
it is a many to many relationship and I have used "prevselected" and
"selected" properties to track which checkboxes of each postal code the user
checked or unchecked in a grid so that only add or delete a row in the
middle table (between postal code and agent tables) and do nothing for the
postal code that there were no activity on them by user.
Default Public ReadOnly Property Item(ByVal Index As Integer) As
clsAgentPostalCode

Get

Return CType(List(Index), clsAgentPostalCode)

End Get

End Property

Would you please what is wrong to my databinding code?

If Not Page.IsPostBack Then

dgPostalCode.DataKeyField = "AssignedPostalCodeID"

Dim oAgentPostalCodeCollection As New clsAgentPostalCodeCollection(lAgentID)

dgPostalCode.DataSource = oAgentPostalCodeCollection

dgPostalCode.DataBind()

End If

"Cor" <non@non.com> wrote in message
news:eV0WHUv8DHA.3200@TK2MSFTNGP09.phx.gbl...
> Hi Andy,
>
> You try to make from your dataset a collection to bind that to a datagrid.
> The ideal collection to bind to a datagrid as a datasource is the
datatable
> a part of the dataset.
>
> What is the reason you take this very difficult route?
> (While it is a webpage and therefore the collection is gone when you have
> binded it, because I do not see it been saved somewhere by you).
>
> Cor
>
>



Relevant Pages

  • Re: Error: No default member found for type MyClass
    ... Return CType, clsAgentPostalCode) ... Dim oAgentPostalCodeCollection As New clsAgentPostalCodeCollection ... > You try to make from your dataset a collection to bind that to a datagrid. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Best Method For Binding to a Datagrid?
    ... you can't bind ot a reader. ... Would I be better off not using databindings and populating the datagrid by ... >> you can't bind a SqlDataReader to the datagrid. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: ASP.NET Remoting problem
    ... > I have added a web reference to this service. ... > But now I cannot bind an array of this object to a DataGrid because ... > properties to be able to bind with data grid. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: ASP.NET Remoting problem
    ... > I have added a web reference to this service. ... > But now I cannot bind an array of this object to a DataGrid because ... > properties to be able to bind with data grid. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: DataGrid.Binding()
    ... strings to which to bind. ... Bindable controls can bind to any object that has ... You cannot bind a DataTable with a custom object. ... A Datagrid can be bound TO ...
    (microsoft.public.dotnet.framework.aspnet)