title: Scroll to item in listview in Silverlight 3
body: <p>I have a silverlight 3 app with a textbox on the main window and a childwindow that has a list of all the potential textbox values.  When I open that childwindow I want it to scroll to the correct one in the list.</p>
  
  <p>I'm trying to do this with the code below...using the ScrollIntoView.  It was not working at all until I add the UpdateLayerout().  However it does not seem to work all the time.  At times it scrolls but not all the way to the item, it is a few items higher than it should be.  The listbox is in an Accordion and the list items use a ItemTemplate\DataTemplate, not sure if that effects anything but thought I'd mention it.</p>
  
  <p>Any ideas what I'm missing in the code below?</p>
  
  <p>What I would like is to scroll the item to the top of the list ....any ideas how to that?</p>
  
  <p>(Or any other suggestions on how to code this better)</p>
  
  <p>Thanks!</p>
  
  <pre><code>for (int index = 0; index &lt; myList.Items.Count; index++) {
          object obj = myList.Items[index];
          var listItem= obj as listItemObject;
          if (listItemObj != null)    {
              if (string.Compare(listItemObj.id, _PastedInId, StringComparison.InvariantCultureIgnoreCase) == 0) {
                  selectThisIndex = index;
                  scrollToThisItem = obj;
              }
          }
      }
      myList.SelectedIndex = selectThisIndex;
      if (scrollToThisItem != null){
          myList.UpdateLayout();
          myList.ScrollIntoView(scrollToThisItem);
      }
  </code></pre>