Hey,
Who can give me a hint on this case?
Let's say I have an object "MyObject" with the following properties (this is a breakdown for easier explination)
public clas MyObject
{
public string Column { get; set; }
public string Value { get; set; }
public int Row { get; set; }
}
When this get's populated I then create a List<MyObject> which I need to sort based on different column names.
Ex: this is how the list would look like when populated. The ElementAt(i) is there to signify that there is a MyObject instance in the list.
ElementAt(i) Row Column Value
0 1 FirstName John
0 1 LastName Doe
0 1 BirthDate 01-01-1900
1 2 FirstName Jane
1 2 LastName Doe
1 2 BirthDate 01-01-1901
2 3 FirstName Mary
2 3 LastName Poppins
2 3 BirthDate 01-01-1910
3 4 FirstName Mark
3 4 LastName Whalberg
3 4 BirthDate 01-01-1905
As you can see I can easily pivot it to a table which get displayed into a report afterwards. How would you go about sorting it by "Column" value before sending it to the report. Right now I only found a cumbersome way of translating it to a DataTable and do the sorting there and then recreate the list to pass to the report.
Thanks