private void AutoSetMenuSort(DevExpress.XtraTreeList.Nodes.TreeListNode node) { node.SetValue("iSort", iSort); iSort++; foreach (DevExpress.XtraTreeList.Nodes.TreeListNode item in node.Nodes) { item.SetValue("iSort", iSort); iSort++; if (item.HasChildren && item.HasAsParent(node)) { AutoSetMenuSort(item); } } }