C Board  

Go Back   C Board > General Programming Boards > C# Programming

Reply
 
LinkBack Thread Tools Display Modes
Old 07-16-2002, 12:50 PM   #1
Registered User
 
Join Date: Sep 2001
Posts: 173
listview

Hi:
how to add an array to viewlist?
I just can't find the way to define such array so that I can use it

I've tried such way:

viewList1.Item[] item = new viewList1.Item[3];
ListViewItem[] item = new ListViewItem[3];
but neither of them works.
I've checked MSDN
it has such example:
viewList1.Item[0].SubItems.Add("John Smith");

I don't know how to create such things Item[0]
thanx
__________________
Don't laugh at me,I am just a SuperNewbie.
SuperNewbie is offline   Reply With Quote
Old 07-16-2002, 01:45 PM   #2
the hat of redundancy hat
 
nvoigt's Avatar
 
Join Date: Aug 2001
Location: Hannover, Germany
Posts: 2,769
PHP Code:
ListViewItem l = new ListViewItem();

l.Text "First Item";

l.SubItems.Add"subitem1" );
l.SubItems.Add"subitem2" );  

listView1.Items.Add); 
__________________
hth
-nv

She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."

When in doubt, read the FAQ.
Then ask a smart question.
nvoigt is offline   Reply With Quote
Old 07-16-2002, 01:50 PM   #3
Registered User
 
Join Date: Sep 2001
Posts: 173
Thanx, I got it
and also I found out
ListViewItem[] item = new ListViewItem[X];
it works great for arrays.

but how could I get the subitem's name using something like
l.subitem.????
__________________
Don't laugh at me,I am just a SuperNewbie.

Last edited by SuperNewbie; 07-16-2002 at 01:56 PM.
SuperNewbie is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ListView Refresh, Update de4th C++ Programming 1 12-23-2006 09:13 AM
help coloring individual listview item instead of all listview item in visual c++ 6 method Windows Programming 6 07-10-2006 12:05 AM
Troubles with ListView and Toolbar cornholio Windows Programming 8 11-14-2005 01:26 AM
Listview with c/c++ X PaYnE X Windows Programming 8 03-20-2005 11:29 PM
Listview?? SuperNewbie C# Programming 4 02-13-2003 03:34 AM


All times are GMT -6. The time now is 09:31 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22