all groups > dotnet windows forms databinding > august 2004 >
You're in the

dotnet windows forms databinding

group:

Binding objects that contain other objects


Binding objects that contain other objects Dan
8/15/2004 3:19:57 AM
dotnet windows forms databinding:
Hi Everyone

Is it possible to bind an object that contains other objects to a datagrid.

For example if I have a person object which exposes as a property an address
object, is it possible to bind this to a datagrid, say the name property of
the person object and the city property within the address object.

Thanks in advance
Dan

Re: Binding objects that contain other objects Sijin Joseph
8/15/2004 1:37:36 PM
The DataGrid will not bind more than one level deep into the object
hierarchy, you will need to implement ICustomTypeDescriptor and provide
proxy properties for your innner objects.

--
Sijin Joseph
http://www.indiangeek.net
http://weblogs.asp.net/sjoseph


[quoted text, click to view]

Re: Binding objects that contain other objects walter leinert
8/23/2004 1:40:27 PM
Hi Dan,

in our project we are using a datagrid like a listview in detail mode. I
derived our GridView from DataGrid and implemented special custom grid
column styles with designer support. In the custom grid column styles i fire
formatting events for each grid view row if listeners are registered for my
custom events. In the corresponding formatting event handler you can
calculate any value to display in the grid cell. E.g. i am calculating an
image index for images to be displayed for certain column items or a value
from an object property referenced by the current item property.

If you are interested in more details i can give more information.


Regards, Walter


"Dan" <daniel@hawkins1978.fsnet.co.uk> schrieb im Newsbeitrag
news:%23Yiz05mgEHA.3944@tk2msftngp13.phx.gbl...
[quoted text, click to view]

AddThis Social Bookmark Button