DavidJGu's Blog

       尼采说,宁可追求虚无也不能无所追求!  Keeping is harder than winning
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

Simple operation algorithm of WebTree(2)

Posted on 2004-09-08 16:03  Let's DotNet  阅读(460)  评论(0编辑  收藏  举报
public static string GetCheckedNodesofTree(Infragistics.WebUI.UltraWebNavigator.UltraWebTree objUltraTree)
        
{
            
string strTagsSet = "";
                        
int iCount = objUltraTree.Nodes.Count;
            
for(int i=0; i<iCount; i++)
            
{
                strTagsSet 
+= GetCheckedNodes(objUltraTree.Nodes[i])+"|";
            }

            strTagsSet 
= strTagsSet.TrimEnd('|');
            
return strTagsSet;
        }

        
private static string GetCheckedNodes(Infragistics.WebUI.UltraWebNavigator.Node objNode)
        
{
            
string strTags ="";
            
int iCount = objNode.Nodes.Count;
            
if (iCount == 0 && objNode.Checked)
            
{
                
return objNode.Tag.ToString().TrimEnd('|');
            }

            
else
            
{
                
for(int i=0; i<iCount; i++)
                
{
                    
string strTemp = GetCheckedNodes(objNode.Nodes[i]);
                    strTags 
+= (strTemp.Trim()==""?"":strTemp+"|");
                }

                
return strTags.TrimEnd('|');
            }

        }