Silverlight Treeview 相关操作:加载,保存,索引节点,节点移动,模板节点
2009-03-14 12:00:33 来源:WEB开发网
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);
Tags:Silverlight Treeview 相关
编辑录入:爽爽 [复制链接] [打 印]- ››silverlight全屏显示图片
- ››Silverlight MVVM 模式(一) 切近实战
- ››Silverlight for Windows Phone 7开发系列(1):...
- ››Silverlight for Windows Phone 7开发系列(2):...
- ››Silverlight for Windows Phone 7开发系列(3):...
- ››Silverlight for Windows Phone 7开发系列(4):...
- ››Silverlight for Symbian
- ››Silverlight3系列(四)数据绑定 Data Binding 1
- ››silverlight2 游戏 1 你能坚持多少秒
- ››Silverlight开发实践--PicZoomShow
- ››Silverlight自定义控件开发 - 令人懊恼的OnApplyT...
- ››Silverlight 2 RTW中ToolTipService.ToolTip不继承...
更多精彩
赞助商链接