title: How break after checking / unchecking a node in a treelist
body: <p>I have a little problem. 
  i should implement a logic for a treeList which consist from a single parent and more children   grouped into more groups by ID's. </p>
  
  <p>I have an action which treats all nodes:</p>
  
  <pre><code>long callerGroup = -1L;
  
  if (callerNode != null)
  {
      var service = this.tlServices.GetDataRecordByNode(callerNode) as __ServiceInfo;
  
      if (service != null)
      {
          callerGroup = service.Group;
      }
  }
  
  Action&lt;TreeListNodes&gt; action = null;
  
  action = (nodes) =&gt;
  {
      if (nodes != null &amp;&amp; nodes.Count &gt; 0)
      {
          foreach (TreeListNode node in nodes)
          {
              if (node.Level == 0 &amp;&amp; !node.Checked)
              {
                  node.Checked = true;
                  break;
              }
              else
              {
                  var service = this.tlServices.GetDataRecordByNode(node) as __ServiceInfo;
  
                  if (service != null)
                  {
                      var group = service.Group;
  
                      //for ' 1 &lt;= group &lt;= 100' -&gt; Mandatory Service, only ONE from group
                      if (callerGroup &gt;= 1 &amp;&amp; callerGroup &lt;= 100)
                      {
                          if (group &gt;= 1 &amp;&amp; group &lt;= 100)
                          {
                              //node.Checked = true; - not done
                          }
                      }
  
                      //for ' 101 &lt;= group &lt;= 1000 ' -&gt; Mandatory Service, minimum ONE from group, but allow and MORE
                      if (callerGroup &gt;= 101 &amp;&amp; callerGroup &lt;= 1000)
                      {
  
                      }
  
                      //for ' group &gt;= 1001 ' -&gt; optional Service, ALL from group
                      if (callerGroup &gt;= 1001 &amp;&amp; group &gt;= 1001)
                      {
                          node.Checked = !node.Checked; // --&gt; DONE. 
                      }
                  }
              }
              action(node.Nodes);
          }
      }
  };
  
  action(this.tlServices.Nodes);
  </code></pre>
  
  <p>I have 3 cases:</p>
  
  <ul>
  <li>#1. if <em>1 &lt;= group &lt;= 100</em> -> Mandatory Service, allow only ONE from group</li>
  <li>#2. if <em>101 &lt;= group &lt;= 1000</em> -> Mandatory Service, allow minimum ONE from group, but allow and MORE</li>
  <li>#3. if <em>group >= 1001</em> -> optional Service, Check/ Uncheck ALL from group.</li>
  </ul>
  
  <p><strong>Result:</strong>
  The #3 I've done easy, but how can i implement #1.</p>