Click here to Skip to main content
15,911,789 members
Home / Discussions / C#
   

C#

 
GeneralRe: Dynamic report generation Pin
Mycroft Holmes2-May-09 14:34
professionalMycroft Holmes2-May-09 14:34 
QuestionNeed a datagridview like excel spreadsheet Pin
Reyhaneh631-May-09 21:10
Reyhaneh631-May-09 21:10 
AnswerRe: Need a datagridview like excel spreadsheet Pin
dan!sh 1-May-09 23:33
professional dan!sh 1-May-09 23:33 
Questionsend mouse click to a specified control on another program? Pin
Darkdude9891-May-09 21:09
Darkdude9891-May-09 21:09 
AnswerRe: send mouse click to a specified control on another program? Pin
Member 10339071-May-09 22:16
Member 10339071-May-09 22:16 
AnswerRe: send mouse click to a specified control on another program? Pin
dan!sh 1-May-09 22:16
professional dan!sh 1-May-09 22:16 
GeneralRe: send mouse click to a specified control on another program? Pin
Member 10339072-May-09 0:20
Member 10339072-May-09 0:20 
GeneralRe: send mouse click to a specified control on another program? Pin
Darkdude9892-May-09 14:11
Darkdude9892-May-09 14:11 
AnswerRe: send mouse click to a specified control on another program? Pin
Member 10339073-May-09 1:17
Member 10339073-May-09 1:17 
QuestionNull reference Exception while using Ipc with Remoting in .net 2.0 Pin
chandu19251-May-09 20:08
chandu19251-May-09 20:08 
QuestionQuestion on mshtml. Pin
Evgeni571-May-09 19:56
Evgeni571-May-09 19:56 
QuestionRe: Question on mshtml. Pin
Member 10339071-May-09 22:22
Member 10339071-May-09 22:22 
AnswerRe: Question on mshtml. Pin
Evgeni571-May-09 22:43
Evgeni571-May-09 22:43 
GeneralRe: Question on mshtml. Pin
dan!sh 1-May-09 23:18
professional dan!sh 1-May-09 23:18 
AnswerRe: Question on mshtml. Pin
Member 10339071-May-09 23:32
Member 10339071-May-09 23:32 
QuestionDisplay Datetime As per GMT Pin
Sun Rays1-May-09 19:35
Sun Rays1-May-09 19:35 
QuestionHow to connect excel database Pin
kaushik_dass1-May-09 19:34
kaushik_dass1-May-09 19:34 
AnswerRe: How to connect excel database Pin
Sun Rays1-May-09 19:38
Sun Rays1-May-09 19:38 
QuestionNoob question: Displaying a List in a ListView Pin
Quake2Player1-May-09 19:00
Quake2Player1-May-09 19:00 
Hi,
I want to know if this is the way to work with ListViews:

I noticed that ListViews contain strings only.. so.. if I have a List of persons List<Person>, and each Person has properties Id, Name, Age, and much more.

I want to display only name and age (there are two columns in the ListView: Name, Age),

My question:
I'd like to work with the Person (object Person!) selected.. I'm currently doing it this way:

Adding the items to the list:
foreach (Person person in personList)
{
                ListViewItem lvi = new ListViewItem();
                lvi.SubItems.Add(person.Name);
                lvi.SubItems.Add(person.Age.ToString());
                lvi.SubItems.Add(person.Id.ToString()); 

                listView1.Items.Add(lvi);
}


And the subitem Id is not listed because of "lack of column", i mean: There are two columns.. so Id is not displayed because it would need 3 columns..

Then, that way i can use the Id of the person and refer to the object..

Is this the way one would do that ? I suppose not because it doesnt look very nice..
In fact if i would add later a new column i would have to change things

Help please!
AnswerRe: Noob question: Displaying a List in a ListView Pin
Member 10339071-May-09 22:34
Member 10339071-May-09 22:34 
AnswerRe: Noob question: Displaying a List in a ListView Pin
DaveyM691-May-09 23:24
professionalDaveyM691-May-09 23:24 
GeneralRe: Noob question: Displaying a List in a ListView Pin
Quake2Player2-May-09 8:41
Quake2Player2-May-09 8:41 
GeneralRe: Noob question: Displaying a List in a ListView Pin
DaveyM693-May-09 0:28
professionalDaveyM693-May-09 0:28 
QuestionDateTime problem Pin
soulidentities1-May-09 17:26
soulidentities1-May-09 17:26 
AnswerRe: DateTime problem Pin
Garth J Lancaster1-May-09 18:29
professionalGarth J Lancaster1-May-09 18:29 

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.