WEB开发网
开发学院图形图像Flash Silverlight Treeview 相关操作:加载,保存,索引节... 阅读

Silverlight Treeview 相关操作:加载,保存,索引节点,节点移动,模板节点

 2009-03-14 12:00:33 来源:WEB开发网   
核心提示: Node node = tvshow.Selected; if (node != null) { node.SwapPrevious(); // node.SwapNext(); }遍历保存节点索引ObservableCollection<PDMInfo> PDMInfos

     Node node = tvshow.Selected;
            if (node != null)
            {
                node.SwapPrevious();

                // node.SwapNext();
            }

遍历保存节点索引

 ObservableCollection<PDMInfo> PDMInfos = new ObservableCollection<PDMInfo>();

            int m = 0;

            PDMInfo info = new PDMInfo();

            for (int i = 0; i < tvshow.Nodes.Count; i++) //phase
            {
                Node phase = tvshow.Nodes[i] as Node;
                m = m + 1;

                int PhaseID = Convert.ToInt32(phase.Tag);

                info = new PDMInfo()
                {
                    ID = PhaseID,
                    IDX = m
                };

                PDMInfos.Add(info);

                for (int j = 0; j < phase.Nodes.Count; j++)
                {
                    Node task = phase.Nodes[j] as Node;

                    m = m + 1;
                    int TaskID = Convert.ToInt32(task.Tag);

                    info = new PDMInfo()
                    {
                        ID = TaskID,
                        IDX = m
                    };

                    PDMInfos.Add(info);

                    for (int n = 0; n < task.Nodes.Count; n++)
                    {
                        Node item = task.Nodes[n] as Node;

                        m = m + 1;
                        int ItemID = Convert.ToInt32(item.Tag);

                        info = new PDMInfo()
                        {
                            ID = ItemID,
                            IDX = m
                        };

                        PDMInfos.Add(info);

                    }
                }
            }

            client.UpdatePDMInfoToDBCompleted += new EventHandler<System.ComponentModel.AsyncCompletedEventArgs>(client_UpdatePDMInfoToDBCompleted);
            client.UpdatePDMInfoToDBAsync(PDMInfos);

上一页  1 2 3 4 5 

Tags:Silverlight Treeview 相关

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接