title: Listbox ScrollIntoView problem wpf
body: <p>I am creating a listbox with itemsource of type dataview. I want to scroll the listbox to praticular item which is not selected. I am using the following code for selected item.</p>
  
  <p>Code:</p>
  
  <p>Binding listbox:  </p>
  
  <pre><code>DataView dv = newDt.DefaultView;
              dv.Sort = "Count Desc";
              lbResult.DataContext = dv;
  </code></pre>
  
  <p>To get the row based on id:</p>
  
  <pre><code> var selectResult = from mypro in albumDetails.ToTable().AsEnumerable() where mypro.Field&lt;string&gt;("ID")==search.ID  select mypro;
  
              if (lbResult.SelectedItem != null)
              {
                  lbResult.ScrollIntoView(**lbResult.Items[0]**);
              }
  </code></pre>
  
  <p>How to get the index if the row in the list box.</p>
  
  <p>Geetha</p>