title: Sharepoint Custom Field Render pattern: loop through Sub Columns of Multiple Column field
body: <p>I have a Custom Sharepoint field that inherits from <code>SPFieldMultiColumn</code>. the values of the field appear like this:</p>
  
  <blockquote>
    <p>";#column one value;#column two
    value;#column three value;#"</p>
  </blockquote>
  
  <p>I want to display each item in a separate line and remove the </p>
  
  <blockquote>
    <p>;#</p>
  </blockquote>
  
  <p>I checked this link <a href="http://msdn.microsoft.com/en-us/library/ms411957(office.12).aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/ms411957(office.12).aspx</a>
  and found that this can be achieved by overriding the render pattern of the field like this</p>
  
  <pre><code>&lt;RenderPattern Name="DisplayPattern" DisplayName="DisplayPattern"&gt;
    &lt;Switch&gt;
      &lt;Expr&gt;
        &lt;GetVar Name="FreeForm"/&gt;
      &lt;/Expr&gt;
      &lt;Case Value="TRUE"&gt;
        &lt;Column/&gt;
      &lt;/Case&gt;
      &lt;Default&gt;
        &lt;HTML&gt;
          &lt;![CDATA[ &lt;DIV ALIGN=RIGHT&gt; ]]&gt;
        &lt;/HTML&gt;
        &lt;Column/&gt;
        &lt;HTML&gt;
          &lt;![CDATA[ &lt;/DIV&gt; ]]&gt;
        &lt;/HTML&gt;
      &lt;/Default&gt;
    &lt;/Switch&gt;
  &lt;/RenderPattern&gt;
  </code></pre>
  
  <p>bu this requires that the number of SubColumns to be predefined, in my case it can be any number.</p>
  
  <p>so I need a for loop to loop through each subcolumn in my multiple column field?</p>
  
  <p>how can this be done ?
  thanks</p>