Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm Data Binding / September 2006

Tip: Looking for answers? Try searching our database.

DataGridView object within a collection from web services

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Liming - 25 Sep 2006 06:32 GMT
Hi,

I have an object within a collection. This object has an attribute that
I need to bind to a datagridview column.

I saw this thread

http://groups.google.com/group/microsoft.public.dotnet.framework.windowsforms.da
tabinding/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.

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.
Bart Mermuys - 25 Sep 2006 16:55 GMT
Hi,

> 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.

> I saw this thread
>
[quoted text clipped - 3 lines]
> 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/webservicewrap
per.mspx


Or another wsdl tool that can generate properties:
http://weblogs.asp.net/cweyer/archive/2003/11/21/39070.aspx

HTH,
Greetings

> I guess the next best thing for me is to write a converter for this
> webservices and convert it using the .ToString() method described.
[quoted text clipped - 4 lines]
>
> Any suggestion is greatly appreicate it.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.