I am writing a program to set a sequence in which various objects will appear in report. The sequence is the Y position (cell) on Excel spreadsheet.
A demo part of co
Thanks a lot for your help. While searching more, I found this solution. (Available in Stackoverflow.com in other question)
First, I created a class which would encapsulate my objects for classes (Headers,Footer etc)
public class MyPosition
{
public int Position { get; set; }
public object MyObjects{ get; set; }
}
So this class is supposed to hold on the objects, and PosX of each object goes as int Position
List Sequence= new List();
Sequence.Add(new MyPosition() { Position = 1, Headerobject });
Sequence.Add(new MyPosition() { Position = 2, Headerobject1 });
Sequence.Add(new MyPosition() { Position = 1, Footer });
League.Sort((PosA, PosB) => PosA.Position.CompareTo(PosB.Position));
What eventually I get is the sorted "Sequence" list.