Databinding to member objects

    Date: 07/09/06 (C Sharp)    Keywords: no keywords

    Is there a way to tell a control to bind to an object that's a propery of another object?

    Say for example, I have the following classes:

    public class Cat
    {
               public string Name;
               public Dog Enemy;
    }
    public class Dog
    {
               public string Name;
    }
    


    Is there a way to bind a control to someCat.Enemy.Name? I'm specifically using a DataGridViewTextBoxColumn, and I want to set the DataPropertyName (this is similar to using a DataGrid though).

    Please save me from having to load everything manually!

    Source: http://community.livejournal.com/csharp/68816.html

« Deregistering an event... || PerformanceCounter class »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home