Click here to Skip to main content
15,904,416 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
I have a listview with the columns Dealer, RecievedDate, ResolvedDate, Aging and Status(active and closed). I need to update all the rows that are still Active, where the Aging is the difference of the Current date and the RecievedDate every load of the form.
Sergey Alexandrovich Kryukov 15-May-15 13:33pm    
ListView? Which one? In .NET FCL, there are at least 3 classes under this simple name. Please, give us a full type name.
Member 11620658 15-May-15 18:08pm    
it is System.Windows.Forms.ListView . I'm sorry im just a newbie..
Sergey Alexandrovich Kryukov 15-May-15 21:26pm    
My congratulations. Many other "newbies" are unable to answer this question. Thank you. (I'm not joking.)
Member 11620658 15-May-15 13:43pm    
what classes do you mean?
Ravi Bhavnani 15-May-15 14:20pm    


1 solution

stebo0728 gave you a pretty good idea. From your question, it looks like you want to use the View = System.Windows.Forms.View.Details.
In many cases, you can get much better results using System.Windows.Forms.DataGridView:[^].

You don't need to update the view; it is updated when you modify data, in this case, System.Windows.Forms.DataGridViewCell.Value property:[^],[^].

Same thing goes with System.Windows.Forms.ListView. The view is changes when you modify ListViewItem or ListViewItem.ListViewSubItem. Please read the documentation carefully, including the code sample, and try it out:[^],[^],[^].

If you are using the database, first of all, consider using binding. Please see:[^],
A Detailed Data Binding Tutorial[^],
Data binding concepts in .NET windows forms[^].

Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900