I did a Pre-Order and an In-Order as on the picture, but I don't know how to do the Post-Order in a TreeView.
https://imgur.com/a/HjwLGwe#8RhzxYR
I know my code looks stupid. I tried that if a number is different from the first row value of the row then it changes the color of the row, so I wanted to implement this into my treeview, so there is the root number as the first value, then if next value is bigger then in the TreeView the number goes above of the root number othervise below.
Is there any other way to do it a post-order sort in treeview by it content?
Sorry for my english, also I am beginner in C#.
What I have tried:
int a = Convert.ToInt32(dataGridView1.Rows[0].Cells[3].Value);
int b = Convert.ToInt32(row.Cells[3].Value);
for (int i = 1; i < dataGridView1.Rows.Count; i++)
{
if (a <= b)
{
row.DefaultCellStyle.BackColor = Color.FromArgb(144, 238, 144);
panel1.BackColor = Color.FromArgb(144, 238, 144);
dataGridView1.Rows[0].Cells[4].Value.Equals(textBoxAnumber.Text);
}
else
{
row.DefaultCellStyle.BackColor = Color.FromArgb(255, 106, 106);
panel4.BackColor = Color.FromArgb(255, 106, 106);
treeViewPost.Nodes.Add("S " + dataGridView1.Rows[i].Cells[3].Value.ToString());
}
}