Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Closed Thread
Old 02-13-2009, 05:31 PM   #1 (permalink)
office politics's Avatar
 
It's all just 1s and 0s

Join Date: Jan 2004

Location: in the lab

Posts: 4,425

office politics will become famous soon enough

Default c# listview columns

I wish to find out how I can values to different columns in a listview (details mode). The code below adds items to a list view, but it only adds data to one column. The data it is adding is a URL to a file or folder. I would like to add two columns; item number and file status. item number will count the files and file status will show the file's download status. Any help would be greatly appreciated.


Code:
                for (int i = 0; i < DirList.Length; i++)
                {
                    fi = FileInfo(DirList[i]);
                    ListViewItem item;
                    if (fi.Groups["dir"].Value.Equals("<DIR>"))
                    {
                        item = new ListViewItem(servPath + "/" + fi.Groups["name"].Value + "/");
                        FolderURL.Push(servPath + "/" + fi.Groups["name"].Value);
                    }
                    else {
                        item = new ListViewItem(servPath + "/" + fi.Groups["name"].Value);
                    }
                    lvFiles.Items.Add(item);
                }

office politics is offline  
Old 02-14-2009, 08:22 PM   #2 (permalink)
office politics's Avatar
 
It's all just 1s and 0s

Join Date: Jan 2004

Location: in the lab

Posts: 4,425

office politics will become famous soon enough

Default Re: c# listview columns

C# listView, how do I add items to columns 2, 3 and 4 etc? - Stack Overflow
office politics is offline  
 
Closed Thread

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On