I'm working on aforge. I have a list of data which I Draw on the screen next to blobs. I'm also adding the data to a list box. But Instead of getting added in a left to right sequence, its getting added as per the blob's XY coordinate as shown below in the first listbox.
I tried to sort the list using Linq by the OrderBy method but then it orders the whole list in ascending order. I dont want that, I want the list to be sorted by the first line, then the next line and so on. I tried using take<> to sort it by the first row, but it only sorts the first row of 5 int and then stops.
Code :
int n = 5;
elements = elements.Take(n).OrderBy(i => i).ToList();
foreach (var cogxx in elements)
{
listBox2.Items.Add(cogxx);
}
If List coord = new List{80,90,100,60,70,20,40,30,10,50,} if user input int row is 2 then output should be {60,70,80,90,100,10,20,30,40,50} How can I do this?