Custom Object Display & Modfication

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?Q2hhcmxlcw==?=

    Custom Object Display & Modfication

    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
  • James Hahn

    #2
    Re: Custom Object Display & Modfication

    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" <Charles@discus sions.microsoft .comwrote in message
    news:5DB1AD6C-8EA6-4977-AE59-E94F762E2588@mi crosoft.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

    Comment

    Working...