Click here to Skip to main content
15,913,339 members
Home / Discussions / C#
   

C#

 
GeneralRe: Adding list of File names from Folder to a Dropdownlist in C# Pin
Giorgi Dalakishvili15-Jan-09 22:18
mentorGiorgi Dalakishvili15-Jan-09 22:18 
GeneralRe: Adding list of File names from Folder to a Dropdownlist in C# Pin
Guffa16-Jan-09 1:20
Guffa16-Jan-09 1:20 
QuestionArrayList as member of another array list Pin
ptr_Electron15-Jan-09 19:49
ptr_Electron15-Jan-09 19:49 
AnswerRe: ArrayList as member of another array list Pin
Guffa15-Jan-09 20:25
Guffa15-Jan-09 20:25 
QuestionHow to Create MouseDoubleClick Event in C# Pin
raj23136215-Jan-09 19:32
raj23136215-Jan-09 19:32 
AnswerRe: How to Create MouseDoubleClick Event in C# Pin
dan!sh 15-Jan-09 21:11
professional dan!sh 15-Jan-09 21:11 
Questionhow to use the listviewitem... Pin
lincyang15-Jan-09 19:30
lincyang15-Jan-09 19:30 
AnswerRe: how to use the listviewitem... Pin
SeMartens15-Jan-09 21:15
SeMartens15-Jan-09 21:15 
Hi,

what I normally do with listview-items is to create a derived class from ListViewItem, passing the object to display to the constructor and building all subitems within a method called from the constructor.

class MyListViewItem:ListViewItem {

   public MyListViewItem(DateTime dtDate):base(String.Empty) {
     this.BuildItem(dtDate);
   }

   private void BuildItem(DateTime dtDate) {
      this.SubItems.Add(dtDate.Year);
      this.SubItems.Add(dtDate.Month);
      this.SubItems.Add(dtDate.Day);
   }
}


Then I can use objects from this class to add them to the ListView:

listview1.Items.Add(new MyListViewItem(DateTime.Now));


Look at the following link to get an idea for SubItems

http://msdn.microsoft.com/de-de/library/system.windows.forms.listviewitem(VS.80).aspx[^].

Let me know if this helps you.

Regards
Sebastian

P.S.: The code of MyListViewItem is just an example. Within the BuildItem-method you must take care of already existing subitems etc. (Be sure that the ListView is in "Detail"-View mode.)

It's not a bug, it's a feature!

Me in Softwareland.

GeneralRe: how to use the listviewitem... Pin
lincyang20-Jan-09 14:56
lincyang20-Jan-09 14:56 
QuestionImplementation of kerberos in web application without using WSE Pin
lachu00915-Jan-09 19:29
lachu00915-Jan-09 19:29 
QuestionAbout downloading file Pin
tauras8115-Jan-09 18:10
tauras8115-Jan-09 18:10 
AnswerRe: About downloading file Pin
N a v a n e e t h15-Jan-09 19:03
N a v a n e e t h15-Jan-09 19:03 
AnswerRe: About downloading file Pin
ashok_rgm20-Jan-09 0:01
ashok_rgm20-Jan-09 0:01 
AnswerRe: About downloading file Pin
Shyam K Pananghat23-Feb-09 3:18
Shyam K Pananghat23-Feb-09 3:18 
QuestionDataGrid Textbox will not apply value unless enter is pushed Pin
Brad Wick15-Jan-09 17:46
Brad Wick15-Jan-09 17:46 
AnswerRe: DataGrid Textbox will not apply value unless enter is pushed Pin
Aghosh Babu15-Jan-09 18:05
Aghosh Babu15-Jan-09 18:05 
GeneralRe: DataGrid Textbox will not apply value unless enter is pushed Pin
Brad Wick16-Jan-09 6:20
Brad Wick16-Jan-09 6:20 
AnswerRe: DataGrid Textbox will not apply value unless enter is pushed Pin
Mogesh17-Apr-09 0:35
Mogesh17-Apr-09 0:35 
QuestionHow to read from Serial (COM) Port? [modified] Pin
Aghosh Babu15-Jan-09 16:36
Aghosh Babu15-Jan-09 16:36 
AnswerRe: How to read from Serial (COM) Port? Pin
lincyang15-Jan-09 19:57
lincyang15-Jan-09 19:57 
AnswerRe: How to read from Serial (COM) Port? Pin
Bharat Jain15-Jan-09 21:34
Bharat Jain15-Jan-09 21:34 
GeneralRe: How to read from Serial (COM) Port? Pin
Aghosh Babu18-Jan-09 17:34
Aghosh Babu18-Jan-09 17:34 
GeneralRe: How to read from Serial (COM) Port? Pin
Bharat Jain26-Jan-09 20:24
Bharat Jain26-Jan-09 20:24 
QuestionPass Data between forms Pin
Illegal Operation15-Jan-09 13:45
Illegal Operation15-Jan-09 13:45 
AnswerRe: Pass Data between forms Pin
Colin Angus Mackay15-Jan-09 14:09
Colin Angus Mackay15-Jan-09 14:09 

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.