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 / March 2005

Tip: Looking for answers? Try searching our database.

Bind a data grid column to an element of a collection?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Paul Bartlett - 18 Mar 2005 17:07 GMT
[Reposted here as probably more appropriate than
"microsoft.public.vb.controls.databound"]

Could anyone help with the following scenario?

- I have a class that exposes a collection (a Hashtable actually) as a
property.(called Custom).
- I am custom binding a WinForms DataGrid control to a collection of
instances of this class.
- I have discovered that I need to set the mapping name of the
DataGridTableStyle to that of the collection class (ArrayList in my case).
- I can bind columns to "simple" properties of the class by setting the
mapping name equal to the column name.
- What I'd like to do is bind a column to an element in the Hashtable. I
have tried various guesses at the syntax but none seem to work, e.g.:
Custom["Gender"], Custom.Item("Gender") and even just Custom.Gender.

Any ideas, or is this just not possible?

Thanks in advance,
Paul.
Alexander Shirshov - 20 Mar 2005 16:58 GMT
Paul,

It's possible but... elaborate. Have a look at this thread:

http://discuss.develop.com/archives/wa.exe?A2=ind0502C&L=DOTNET-WINFORMS&P=R4310&I=-3

HTH,
Alexander

> [Reposted here as probably more appropriate than
> "microsoft.public.vb.controls.databound"]
[quoted text clipped - 17 lines]
> Thanks in advance,
> Paul.
Paul Bartlett - 21 Mar 2005 09:48 GMT
Thanks for that, Alexander. I'd looked at this interface in the past, but
for some reason had got it into my head that the grid would not use it...

- Paul.

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.