title: WPF Scroll a Uniformgrid
body: <p>I need to display all the files located in a specific path. I have created a user control which contains textblocks for the details of the file (name, size, extension, etc), this control will be the child of the uniform grid.</p>
  
  <p>The problem is, if my uniformgrid is 5x5, and I have over 25 files, 26th element does not be shown.</p>
  
  <p>I'd like to know, is there a way to scroll the content of uniform grid?</p>
  
  <p>I know I can use a listbox and binding (I'm still reading about it), but I need to add the controls programmatically, 'cause the control has an event, and I'm subscribing to it when a new instance of the usercontrol is created and then added to the child array.</p>
  
  <p>I've seen <a href="https://stackoverflow.com/questions/8775420/how-can-i-get-all-the-buttons-in-the-uniformgrid-and-scroll-it-to-see-them-all">this</a> post, and I already placed the uniforgrid inside a ItemsControl, but It does not work at all, this is my xaml:</p>
  
  <pre><code>&lt;ScrollViewer Grid.Column="1" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled" &gt;
      &lt;ItemsControl x:Name="gridArchivos"&gt;
          &lt;ItemsControl.ItemsPanel &gt;
              &lt;ItemsPanelTemplate &gt;
                  &lt;UniformGrid Columns="5" /&gt;
              &lt;/ItemsPanelTemplate&gt;
          &lt;/ItemsControl.ItemsPanel&gt;
      &lt;/ItemsControl&gt;                    
  &lt;/ScrollViewer&gt;
  </code></pre>
  
  <p>According to the post, only cols or rows need to be specified, never both. So, only 5 cols.
  I don't want hrizontal scrolling, only vertical.</p>
  
  <p>Thanks for your time.</p>