title: If datagrid hasn't been shown, I can't set in it current position row (silverlight)
body: <p>i have application with two Tabs. on first tab placed button which sets the current position in dataGrid1 on second tab. While i won't show a second tab, i can't set current position by button1.</p>
  
  <pre><code>&lt;UserControl x:Class="SilverlightApplication9.MainPage"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  mc:Ignorable="d"
  d:DesignHeight="300" d:DesignWidth="400" xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"&gt;
  
  &lt;Grid x:Name="LayoutRoot" Background="White"&gt;
      &lt;sdk:TabControl Height="234" HorizontalAlignment="Left" Margin="52,44,0,0" Name="tabControl1" VerticalAlignment="Top" Width="326"&gt;
          &lt;sdk:TabItem Header="tabItem1" Name="tabItem1"&gt;
              &lt;Grid&gt;
                  &lt;Button Content="Button" Height="23" HorizontalAlignment="Left" Margin="74,44,0,0" Name="button1" VerticalAlignment="Top" Width="75" Click="button1_Click" /&gt;
              &lt;/Grid&gt;
          &lt;/sdk:TabItem&gt;
          &lt;sdk:TabItem Header="tabItem2" Name="tabItem2"&gt;
              &lt;Grid&gt;
                  &lt;sdk:DataGrid ItemsSource="{Binding strs}" RowBackground="White" AutoGenerateColumns="False" Height="141" HorizontalAlignment="Left" Margin="36,12,0,0" Name="dataGrid1" VerticalAlignment="Top" Width="199"&gt;
                      &lt;sdk:DataGrid.Columns&gt;
                          &lt;sdk:DataGridTextColumn Binding="{Binding}" CanUserReorder="True" CanUserResize="True" CanUserSort="True" Width="Auto" /&gt;
                      &lt;/sdk:DataGrid.Columns&gt;
                  &lt;/sdk:DataGrid&gt;
              &lt;/Grid&gt;
          &lt;/sdk:TabItem&gt;
      &lt;/sdk:TabControl&gt;
  &lt;/Grid&gt;
  </code></pre>
  
  <p></p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.ComponentModel;
  using System.Linq;
  using System.Net;
  using System.Windows;
  using System.Windows.Controls;
  using System.Windows.Documents;
  using System.Windows.Input;
  using System.Windows.Media;
  using System.Windows.Media.Animation;
  using System.Windows.Shapes;
  using System.Collections.ObjectModel;
  
  namespace SilverlightApplication9
  {
      public partial class MainPage : UserControl
      {
          private ObservableCollection&lt;string&gt; _strs = new ObservableCollection&lt;string&gt;();
          public ObservableCollection&lt;string&gt; strs { get { return _strs; } set { _strs = value; } }
          public MainPage()
          {
              this.DataContext = this;
              InitializeComponent();
              strs.Add("1");
              strs.Add("2");
              strs.Add("3");
              strs.Add("4");
              strs.Add("5");
          }
          private void button1_Click(object sender, RoutedEventArgs e)
          {
              dataGrid1.SelectedIndex = 2;
          }
      }
  
  }
  </code></pre>