File read/write from a collection
File read/write from a collection
File read/write from a collection
File read/write from a collection
File read/write from a collection
File read/write from a collection File read/write from a collection File read/write from a collection File read/write from a collection File read/write from a collection File read/write from a collection File read/write from a collection File read/write from a collection
File read/write from a collection File read/write from a collection
File read/write from a collection
Go Back  Xtreme Visual Basic Talk > > > File read/write from a collection


Reply
 
Thread Tools Display Modes
  #1  
Old 11-17-2010, 02:45 PM
ejohns ejohns is offline
Newcomer
 
Join Date: Oct 2010
Posts: 4
Default File read/write from a collection


I am working on a program with multiple collections related to one another for a school project. Each collection needs to have its own defined properties and have the objects written (1 per line) to a text file.

I have all of that working.

When reading the comma-separated line from the file, I want to place one of the properties of the object in a listbox (so that all the objects' names will show up in the listbox). I think I have this part figured out...

My problem is that when you click on the name in the listbox, I would like multiple text boxes to be populated with the appropriate, corresponding properties of the particular object in the collection...is there a way for this to be done?
Reply With Quote
  #2  
Old 12-03-2010, 09:38 AM
wildfire1982 wildfire1982 is offline
Senior Contributor
 
Join Date: Jul 2003
Location: Southampton UK
Posts: 801
Default

Yes this can definately be done. The question is how you want to go about it...

If you are using text which is unique per object as the display text, you can store the entirety of the individual objects in a dictionary whereby the key is the unique piece of data (the text being displayed) and the value is an object which is defined with each of the properties you need to store.

With this dictionary you can then add a handler to the item being clicked and write a small simple routine which retrieves the data by using the text that was clicked on to get the properties from the object stored in the dictionary and populate the required text boxes.

If this doesnt meet your needs or doesnt make sense let me know with a few more specifics as to what way you want to go about it. Its just a case of breaking down the problem into smaller chunks.
__________________
Chris
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
File read/write from a collection
File read/write from a collection
File read/write from a collection File read/write from a collection
File read/write from a collection
File read/write from a collection
File read/write from a collection File read/write from a collection File read/write from a collection File read/write from a collection File read/write from a collection File read/write from a collection File read/write from a collection
File read/write from a collection
File read/write from a collection
 
File read/write from a collection
File read/write from a collection
 
-->