Question sort nested list

kss113

New member
Joined
Jan 14, 2016
Messages
1
Programming Experience
10+
I have a list, inside of this list I have 3 entries like below. FilteredList[0],[1], [2], [3], inside each of these items I have a Fields object that has 3 items, example FilteredList[0].Fields[0].
Inside of this Fields object I have the following: DateTypeID = can be anything but in my case it's a string "DATE". I also have DateValue this can be null or have a date value and I have a DisplayValue which is the date as a string.
Each Fields object has this format, what I want to do is sort the fields by dateValue in descending order between the 3 fields objects.
Any help would be greatly appreciated. Thanks, KSS
 
You really need to provide a clear description of the data structure because what you have provided is not clear.
I have a list, inside of this list I have 3 entries like below. FilteredList[0],[1], [2], [3]...
Firstly, you say "list". Does that mean List<T> or are you using it in a more general sense and the actual type is something else? If it's the latter, what is the actual type and, in either case, what is the actual type of the items? Secondly, you say that there are three items but then you seem to show four indexes. I guess we can assume that you just made a mistake there but it adds to the confusion.
...inside each of these items I have a Fields object that has 3 items, example FilteredList[0].Fields[0].
You say that you have a Fields object and you show a Fields property/field. Do you actually mean that you have a Fields property or is that Fields property actually type Fields? Again, the lack of clarity adds to the confusion.
Inside of this Fields object I have the following: DateTypeID = can be anything but in my case it's a string "DATE". I also have DateValue this can be null or have a date value and I have a DisplayValue which is the date as a string.
Are you now talking about properties of the object or is the object an array or collection and these are elements or items in it?

The answer to your question is going to be fairly easy but the specifics of that answer depend on exactly what types you're dealing with. Please provide a full and clear description of the actual types.
 
Back
Top Bottom