Click here to Skip to main content
16,013,747 members
Home / Discussions / C#
   

C#

 
GeneralRe: OpenFileDialog directory path Pin
Luc Pattyn3-Dec-08 17:47
sitebuilderLuc Pattyn3-Dec-08 17:47 
GeneralRe: OpenFileDialog directory path Pin
tonyjsebastian13-Dec-08 18:18
tonyjsebastian13-Dec-08 18:18 
GeneralRe: OpenFileDialog directory path Pin
Maddie from Dartford3-Dec-08 19:05
Maddie from Dartford3-Dec-08 19:05 
GeneralRe: OpenFileDialog directory path Pin
Guffa3-Dec-08 19:52
Guffa3-Dec-08 19:52 
GeneralRe: OpenFileDialog directory path Pin
Maddie from Dartford3-Dec-08 21:31
Maddie from Dartford3-Dec-08 21:31 
GeneralRe: OpenFileDialog directory path Pin
Guffa3-Dec-08 22:07
Guffa3-Dec-08 22:07 
QuestionWriting All listView1 Items, Weird... Pin
jas0n233-Dec-08 16:52
jas0n233-Dec-08 16:52 
AnswerRe: Writing All listView1 Items, Weird... Pin
CodingYoshi3-Dec-08 17:58
CodingYoshi3-Dec-08 17:58 
A quick look at the ListView class members states that Items is a property which returns ListViewItemCollection so no need to look further. Since you are executing the ToString() method on the ListViewItemCollection it is basically returning a string that represents the current object which is probaly something like System.Something.Something. There is nothing weird about that. If you have a class say:

class Employee
{
public string ToString()
{
// Here is the implementation for the ToString() method. Some classes return the object name, some
// return something meaningful but it all depends on the implementation. Some can event decide
// to return "In your dreams this would work!" which is unlikely but as long it is a string, it is
// valid.
}
}

If you want all the objects then do this:

// First save the ListViewItemCollection returned in a ListViewItemCollection reference
ListViewItemCollection allItems = listView1.Items;

Then iterate over all the items using foreach or some other loop. The other option you have is to extend the ListViewItemCollection class and override the ToString() method to return all the items instead of the base class implementation.

Or you can do this:

foreach(ListViewItem currentItem in listView1.Items)
{
// Here write each item which is currentItem to file
}
AnswerRe: Writing All listView1 Items, Weird... Pin
Christian Graus3-Dec-08 18:11
protectorChristian Graus3-Dec-08 18:11 
GeneralRe: Writing All listView1 Items, Weird... Pin
jas0n233-Dec-08 18:32
jas0n233-Dec-08 18:32 
QuestionData Field Values... Pin
Illegal Operation3-Dec-08 14:30
Illegal Operation3-Dec-08 14:30 
AnswerRe: Data Field Values... Pin
Christian Graus3-Dec-08 14:58
protectorChristian Graus3-Dec-08 14:58 
AnswerRe: Data Field Values... Pin
CodingYoshi3-Dec-08 18:12
CodingYoshi3-Dec-08 18:12 
QuestionQuestion about ZedGraph and Data Types Pin
Rafone3-Dec-08 13:09
Rafone3-Dec-08 13:09 
AnswerRe: Question about ZedGraph and Data Types Pin
Christian Graus3-Dec-08 13:12
protectorChristian Graus3-Dec-08 13:12 
GeneralRe: Question about ZedGraph and Data Types Pin
Rafone3-Dec-08 13:31
Rafone3-Dec-08 13:31 
GeneralRe: Question about ZedGraph and Data Types Pin
Christian Graus3-Dec-08 13:51
protectorChristian Graus3-Dec-08 13:51 
QuestionUsing a TextBox as Console replacement. Pin
Mr.Brainley3-Dec-08 12:16
Mr.Brainley3-Dec-08 12:16 
GeneralRe: Using a TextBox as Console replacement. Pin
Luc Pattyn3-Dec-08 12:38
sitebuilderLuc Pattyn3-Dec-08 12:38 
GeneralRe: Using a TextBox as Console replacement. Pin
User 43300283-Dec-08 14:06
User 43300283-Dec-08 14:06 
GeneralRe: Using a TextBox as Console replacement. Pin
Luc Pattyn3-Dec-08 14:19
sitebuilderLuc Pattyn3-Dec-08 14:19 
GeneralRe: Using a TextBox as Console replacement. Pin
Mr.Brainley7-Dec-08 0:35
Mr.Brainley7-Dec-08 0:35 
QuestionReading files over network asynchronously Pin
CodingYoshi3-Dec-08 12:10
CodingYoshi3-Dec-08 12:10 
QuestionHow to stop windows form from refreshing/updating Pin
Kent K3-Dec-08 11:20
professionalKent K3-Dec-08 11:20 
AnswerRe: How to stop windows form from refreshing/updating Pin
Christian Graus3-Dec-08 11:48
protectorChristian Graus3-Dec-08 11:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.