DavidJGu's Blog

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

Simple operation algorithm of WebTree(1)

Posted on 2004-09-08 16:02  Let's DotNet  阅读(394)  评论(0编辑  收藏  举报
public static void SetsubNodesChecked(ref Infragistics.WebUI.UltraWebNavigator.Node objNode,bool chkState)
        
{
                        
int iCount = objNode.Nodes.Count;
            
if (iCount == 0)
            
{
                
return;
            }

            
for(int i=0;i<iCount;i++)
            
{
                Infragistics.WebUI.UltraWebNavigator.Node objNodeTemp 
= objNode.Nodes[i];
                objNodeTemp.Checked 
= chkState;
                
if(objNodeTemp.Nodes.Count>0)
                
{
                    SetsubNodesChecked(
ref objNodeTemp,chkState);
                }

            }


        }
Call example:
    private void UWTreePositionTree_NodeChecked(object sender, Infragistics.WebUI.UltraWebNavigator.WebTreeNodeCheckedEventArgs e)
        
{
            Infragistics.WebUI.UltraWebNavigator.Node objNode 
= e.Node;
            MaintainCoursesByJobcodeUI.SetsubNodesChecked(
ref objNode,e.Node.Checked);
            
return;

        
        }