Hi,
[quoted text, click to view] "Liming" <lmxudotnet@gmail.com> wrote in message
news:1159162371.291695.126310@e3g2000cwe.googlegroups.com...
> Hi,
>
> I have an object within a collection. This object has an attribute that
> I need to bind to a datagridview column.
>
This is a bit confusing, i guess you're talking about fields not attributes
(attributes have a different meaning in dotnet) and the link to the thread
you posted is about binding properties of subobjects, from the above i
assume that's not what you want.
[quoted text, click to view] > I saw this thread
>
>
http://groups.google.com/group/microsoft.public.dotnet.framework.windowsforms.databinding/browse_thread/thread/f92965be386f3a74
>
> which described the need to modify the business classes. The problem
> with mine is that I'm retriving it from a webservices. I dont' have the
> luxury of modifying it.
DataBinding only works with properties not fields, in the thread there is a
mention of FieldsToPropertiesTypeDescriptionProvider which you could use and
download from
http://msdn.microsoft.com/msdnmag/issues/05/05/NETMatters/. It doesn't require you to change the type, you can register a provider at
startup, ie: (see article too)
TypeDescriptor.AddProvider(new
FieldsToPropertiesTypeDescriptionProvider
(typeof(YourType)), typeof(YourType));
Another option is to use an object wrapper that exposes the fields as real
properties:
http://www.microsoft.com/belux/msdn/nl/community/columns/jtielens/webservicewrapper.mspx Or another wsdl tool that can generate properties:
http://weblogs.asp.net/cweyer/archive/2003/11/21/39070.aspx HTH,
Greetings
[quoted text, click to view] >
> I guess the next best thing for me is to write a converter for this
> webservices and convert it using the .ToString() method described.
>
> Are there any other methods? i could easily do this in ASP.NET using
> Eval("ColumnObject.ColumnObject_Attribuet"), windows form gotta have an
> easy way for it right?
>
> Any suggestion is greatly appreicate it.
>