How can i have a arraylist that has items as arraylist 
Author Message
 How can i have a arraylist that has items as arraylist

Hi everyone.

I need to do this:

I got a list of items called listA. And I would like it to
be a dynamic list. I also need to put this list into
another arraylist..

How can i do that????

Regards,
adeline



Sun, 31 Oct 2004 18:46:02 GMT  
 How can i have a arraylist that has items as arraylist
Ok, here's short example of all of that:

ArrayList al1=new ArrayList();
al.Add(SomeObject);
ArrayList al2=new ArrayList(al1);



Sun, 31 Oct 2004 19:17:27 GMT  
 How can i have a arraylist that has items as arraylist
adeline,

    You can just add the arraylist to another arraylist like any other
object, like this:

// Create an arraylist.
ArrayList pobjArrayList1 = new ArrayList();

// Create a second array list and add.
ArrayList pobjArrayList2 = new ArrayList();
pobjArrayList2.Add(pobjArrayList1);

    Hope this helps.

--
               - Nicholas Paldino [.NET MVP]


Quote:
> Hi everyone.

> I need to do this:

> I got a list of items called listA. And I would like it to
> be a dynamic list. I also need to put this list into
> another arraylist..

> How can i do that????

> Regards,
> adeline



Sun, 31 Oct 2004 20:31:41 GMT  
 How can i have a arraylist that has items as arraylist

Hi thanks for helping me out but i still need to you u to advise me on
this.. thanks

ArrayList al1=new ArrayList();
al.Add(new ListItem("v1", "t1");
al.Add(new ListItem("v2", "t2");

ArrayList al2=new ArrayList(al1);

But how do i actually get the value of the items from al2?

Regards,
adeline.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Sun, 31 Oct 2004 21:46:53 GMT  
 How can i have a arraylist that has items as arraylist
Hi thanks for helping me out but i still need to you u to advise me on
this.. thanks

ArrayList al1=new ArrayList();
al.Add(new ListItem("v1", "t1");
al.Add(new ListItem("v2", "t2");

ArrayList al2=new ArrayList(al1);

But how do i actually get the value of the items from al2?

Regards,
adeline.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Sun, 31 Oct 2004 21:46:52 GMT  
 How can i have a arraylist that has items as arraylist
How about this.

        ArrayList al1=new ArrayList();
        al1.Add(new ListItem("v1", "t1"));
        al1.Add(new ListItem("v2", "t2"));

        ArrayList al2=new ArrayList();
        al2.Add(al1);

Then to get at al1 through al2, use something like

            ListItem listItem1 = (ListItem ) ((ArrayList)al2[0])[1];

=================================================
Clay Burch, Syncfusion, Inc.
visit http://www.syncfusion.com for .NET Essentials


Quote:

> Hi thanks for helping me out but i still need to you u to advise me on
> this.. thanks

> ArrayList al1=new ArrayList();
> al.Add(new ListItem("v1", "t1");
> al.Add(new ListItem("v2", "t2");

> ArrayList al2=new ArrayList(al1);

> But how do i actually get the value of the items from al2?

> Regards,
> adeline.

> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!



Mon, 01 Nov 2004 00:46:59 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. ArrayList in an ArrayList

2. Remove duplicated items in an ArrayList

3. ArrayList - unable to call the Item Property

4. ArrayList Item - Copy or Instance ?

5. binding items of a ListBox with an ArrayList

6. Getting Items Out Of ArrayList

7. how to edit custom list-control items without having the window focused

8. List Control Items As String (still having trouble)

9. ArrayList with dynamic size

10. Problem using IndexOf() with an ArrayList of custom objects

11. Enumerating through and modifying an ArrayList

12. Convert ArrayList to string array

 

 
Powered by phpBB® Forum Software