By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,046 Members | 2,105 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,046 IT Pros & Developers. It's quick & easy.

Custom Object Display & Modfication

P: n/a
I'm running VS2008 & attempting to solve a problem I've encountered while
developing some software for our business.

Here's the basic idea...I've created a class that represents a file (with
members such as file name, file location, and a string containing the files
data). Each file object also contains an ArrayList of another custom object
I've created--a field object (which is basically two fields--field name &
field data). These fields are extracted from the file (as the file is a HTML
document), and are simply text within bracket [ExampleField].

What I'm attempting to do is, every time a file is loaded, create a file
object & the array of fields extracted contained within this file object, and
display this to the user.

I've attempted using a ListView to accomplish this, to no avail, as I don't
believe I can correctly & dynamically link an ArrayList of custom objects to
a ListView control.

I want the user to be able to select an object in the list which corelates
to a certain instance of the file class. Once the user selects this object, I
want to be able to pass a reference to this instance of the file object as an
optional parameter to another form which, in turn, extracts the ArrayList of
field objects & allows the user to edit these fields.

I re-wrote all of my code due to the lack of OO, and now I've hit the same
brick wall as I did in the beginning.

Does anyone know of an efficient way of doing what I'm attempting to
accomplish? Any help, thoughts, etc, would be greatly appreciated!!

Thanks!

-Charles
Nov 14 '08 #1
Share this Question
Share on Google+
1 Reply


P: n/a
What exactly is the 'brick wall' you have run into?

There should be no problem in iterating through the collection of file
objects (although you haven't indicated how this collection is stored) and
populating a listview with an identifier for each object. Then, when the
user selects one, you can retrieve that file object and parse the file data
to create the field objects. Then you repeat the process - iterate through
the field objects to display a list of field identifiers, allow the user to
select a field, retrieve that field object, allow the user to edit it,
replace it into the field collection and eventually write the field objects
back to a new file.

But the use of 'dynamically' in your description of the field objects
suggests I have misunderstood your problem. You cannot dynamically link a
listview to an arraylist collection - you can populate the listview with an
identifier for each arraylist item (each field object). I can't see why you
would need a dynamic association.

"Charles" <Ch*****@discussions.microsoft.comwrote in message
news:5D**********************************@microsof t.com...
I'm running VS2008 & attempting to solve a problem I've encountered while
developing some software for our business.

Here's the basic idea...I've created a class that represents a file (with
members such as file name, file location, and a string containing the
files
data). Each file object also contains an ArrayList of another custom
object
I've created--a field object (which is basically two fields--field name &
field data). These fields are extracted from the file (as the file is a
HTML
document), and are simply text within bracket [ExampleField].

What I'm attempting to do is, every time a file is loaded, create a file
object & the array of fields extracted contained within this file object,
and
display this to the user.

I've attempted using a ListView to accomplish this, to no avail, as I
don't
believe I can correctly & dynamically link an ArrayList of custom objects
to
a ListView control.

I want the user to be able to select an object in the list which corelates
to a certain instance of the file class. Once the user selects this
object, I
want to be able to pass a reference to this instance of the file object as
an
optional parameter to another form which, in turn, extracts the ArrayList
of
field objects & allows the user to edit these fields.

I re-wrote all of my code due to the lack of OO, and now I've hit the same
brick wall as I did in the beginning.

Does anyone know of an efficient way of doing what I'm attempting to
accomplish? Any help, thoughts, etc, would be greatly appreciated!!

Thanks!

-Charles
Nov 14 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.