如何对 UltraTree 中的节点重新排序?
我有一个如下所示的类:
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; }
}
当我像这样绑定数据时:
List<GeneralStatusInfo> statusBind = new List<GeneralStatusInfo>();
statusBind.Add(status);
utGeneralStatusInfo.DataSource = statusBind;
SetupTree(status);
它以不同的顺序放置我的父节点:
Appointment
P/O Number
B/L Number
Origin
Pickup
Notify
Payment
Destination
如何重新排序节点,以便它们以与我在类中的顺序相同的顺序出现?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您必须创建自己的IComparer。像这样:
然后只需设置 UltraTree 实例的 SortComparer 属性:
You have to make your own IComparer. Something like this:
And then just set SortComparer property of your UltraTree instance: