TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
pandiyaraj k
NA
73
8.2k
Sort a custom list - list of struct
Jul 21 2012 11:03 AM
I have struct "StructEventlist " and listed that in List "
LstEventList
"
public struct StructEventlist
{
public string EntryType;
public string EventSource;
public string EventCategory;
public DateTime EventDate;
public int EventID;
public string Message;
}
public List<StructEventlist> LstEventList = new List<StructEventlist>();
Assigned values for struct here
for (i = ev.Entries.Count - 1; i >= 0; i--)
{
EventLogEntry CurrentEntry = ev.Entries[i];
StructEventlist Evlist = new StructEventlist();
Evlist.EntryType = CurrentEntry.EntryType.ToString();
Evlist.EventSource = CurrentEntry.Source;
Evlist.EventCategory = CurrentEntry.Category;
Evlist.EventDate = CurrentEntry.TimeGenerated;
Evlist.EventID = CurrentEntry.EventID;
Evlist.Message = CurrentEntry.Message;
}
Then added to list
LstEventList.Add(Evlist);
Now i want to sort the list "
LstEventList
" by
"Evlist.EventDate".
Please help me!
Reply
Answers (
1
)
What is the difference between two
MULTISELECT TXT FILES IN RICHTEXTBOX IN C#