I've got a class that looks like this:
public class GeneralStatusInfo { public List<string> List_BLNumber { get; set; } public List<POInfo> List_PONumbers { get; set; } public List<string> List_Pickup { get; set; } public List<string> List_Origin { get; set; } public List<string> List_Destination { get; set; } public List<string> List_NotifyName { get; set; } public List<AppmntInformation> List_Appointments { get; set; } }
When I bind the data like this:
List<GeneralStatusInfo> statusBind = new List<GeneralStatusInfo>(); statusBind.Add(status); utGeneralStatusInfo.DataSource = statusBind; SetupTree(status);
It puts my parent nodes in a different order:
Appointment P/O Number B/L Number Origin Pickup Notify Payment Destination
How do I reorder the nodes so they appear in the same order that I have them in my class?
Hi,
I'm not sure I understand what you are asking. Are you talking about the order of the nodes in the tree or the order of the columns? You said "parent nodes", but theres nothing in your post about the order of the nodes, just the columns.
If it's the columns, then the order is determined by the DotNet BindingManager. It gets the order by calling GetPropertyDescriptors on the ITypedList implementation of the data source. So the order is pretty much arbitrary unless you implement ITyledList yourself and return the property descriptors in the order you want.
Assuming you are letting the tree automatically generate the ColumnSets (which is the default), you can change the order of the columns in the tree by handling the ColumnSetGenerated event and setting the OriginX on each column:
e.ColumnSet.Columns["Column A"].LayoutInfo.OriginX = 0;
e.ColumnSet.Columns["Column B"].LayoutInfo.OriginX = 1;
etc.
I
I tried setting the columnset origin, but that did not work. Basically each of the "parent nodes" are lists and each of the "child nodes" are also lists. The way that they are defined in the class are in my post above. I am needing "Destination" to be above "Payments".