Binding object with object properties

From: kh (roadster_at_nospam.nospam)
Date: 12/02/04

  • Next message: Turtle MacDermott: "Re: Display array data in DataGrid control"
    Date: Thu, 2 Dec 2004 08:01:04 -0800
    
    

    Hi. I've been reading up about preparing objects for binding to Windows Forms
    controls. However, I have not seen anything about how to get a control to
    show an object with it's non value-type properties expanded.

    For example consider the following. I want to bind a collection of
    OuterObjects to a DataGrid, but the properties of the InnerObject property
    are not expanded. All I get is the class name displayed as a column, wheras I
    want to see InnerObject's "Name" property as a column. How do I do this
    without creating a wrapper?

    public class OuterObject
    {
        ...
        public InnerObject InnerObject
        {
            get{return innerObject;}
        }
    }
    public class InnerObject
    {
        ...
        public string Name
        {
            get{return name;}
            set{name = value;}
        }
        ...
    }

    Thanks

    kh


  • Next message: Turtle MacDermott: "Re: Display array data in DataGrid control"

    Relevant Pages

    • RE: Adapting ReorderList WebControl for rendering dynamic html
      ... you want to show different controls in each ... ReorderListItem item = container as ReorderListItem; ... public class MyData ... Microsoft Online Community Support ...
      (microsoft.public.dotnet.framework.aspnet.webcontrols)
    • Re: FindControl in Class
      ... Public Class DoesSomething ... Then how do I work it so I can have all my controls and datasets ... Then on every subroutine, I would have: ... Teemu Keiski wrote: ...
      (microsoft.public.dotnet.framework.aspnet)
    • Re: Custom CustomValidator: Properties Window Problems
      ... becuase ValidatedControlConverter returns a list of controls on the ... I created a new class which inherits CustomIDConverter and overrides ... Public Class CustomServerValidator ... Public Property ErrorLabel() As String ...
      (microsoft.public.dotnet.framework.aspnet.buildingcontrols)
    • Re: Static event handler doesnt like forms
      ... Tim Johnson wrote:> I set up a custom event which I fire from another class upon certain> extenal circumstances, but in my form's event handler that catches> the event I can't reference my form controls:> ... > Over in a form I set up the handler like this:> public class MyForm: System.Windows.Forms.Form ... I just can't use my form's controls. ...
      (microsoft.public.dotnet.framework.compactframework)
    • Re: Global datasets
      ... variables and user controls, and try to describe, independently of ASP.Net ... Sticking with the first method again. ... Populate my DataSet from the Database ... public class MyPageClass: System.Web.UI.Page ...
      (microsoft.public.dotnet.framework.aspnet)

    Loading