title: Scroll Viewer not visible in wpf DataGrid
body: <p>I have a datagrid in a grid but the scrollviewer is not visibile even though I made it auto.
  Below in my code. I can't figure out where's the problem.</p>
  
  <p>
      
          
              <br>
          
          
              
              
          </p>
  
  <pre><code>    &lt;Grid Grid.Row="0" Grid.Column="0"&gt;
          &lt;Grid.RowDefinitions&gt;
              &lt;RowDefinition Height="Auto" &gt;&lt;/RowDefinition&gt;
              &lt;RowDefinition Height="Auto" &gt;&lt;/RowDefinition&gt;
              &lt;RowDefinition Height="Auto" &gt;&lt;/RowDefinition&gt;
              &lt;RowDefinition Height="Auto" &gt;&lt;/RowDefinition&gt;
              &lt;RowDefinition Height="Auto" &gt;&lt;/RowDefinition&gt;
              &lt;RowDefinition Height="Auto" &gt;&lt;/RowDefinition&gt;
              &lt;RowDefinition Height="Auto" &gt;&lt;/RowDefinition&gt;
              &lt;RowDefinition Height="Auto" &gt;&lt;/RowDefinition&gt;
              &lt;RowDefinition Height="Auto"&gt;&lt;/RowDefinition&gt;
              &lt;RowDefinition Height="Auto"&gt;&lt;/RowDefinition&gt;
          &lt;/Grid.RowDefinitions&gt;
          &lt;Grid.ColumnDefinitions&gt;
              &lt;ColumnDefinition Width="Auto"&gt;&lt;/ColumnDefinition&gt;
              &lt;ColumnDefinition Width="Auto"&gt;&lt;/ColumnDefinition&gt;
          &lt;/Grid.ColumnDefinitions&gt;
  
          &lt;TextBlock Text="Doctor Name" Grid.Row="0" Grid.Column="0" Margin="5,5,0,0"/&gt;
          &lt;TextBlock Text="Doctor Address" Grid.Row="1" Grid.Column="0" Margin="5,5,0,0"/&gt;
          &lt;TextBlock Text="Entry Note" Grid.Row="2" Grid.Column="0" Margin="5,5,0,0"/&gt;
          &lt;TextBlock Text="Join Date" Grid.Row="3" Grid.Column="0" Margin="5,5,0,0"/&gt;
          &lt;TextBlock Text="Default Discount" Grid.Row="4" Grid.Column="0" Margin="5,5,0,0"/&gt;
          &lt;TextBlock Text="Discount Valid Till" Grid.Row="5" Grid.Column="0" Margin="5,5,0,0"/&gt;
          &lt;TextBlock Text="Employee Name" Grid.Row="6" Grid.Column="0" Margin="5,5,0,0"/&gt;
  
          &lt;Grid Grid.Row="7" Grid.Column="0" Grid.ColumnSpan="2"&gt;
              &lt;Grid.ColumnDefinitions&gt;
                  &lt;ColumnDefinition&gt;&lt;/ColumnDefinition&gt;
                  &lt;ColumnDefinition&gt;&lt;/ColumnDefinition&gt;
                  &lt;ColumnDefinition&gt;&lt;/ColumnDefinition&gt;
              &lt;/Grid.ColumnDefinitions&gt;
  
              &lt;TextBlock Text="Report Type" Grid.Row="0" Grid.Column="0" Margin="5,5,0,0"/&gt;
              &lt;ComboBox Grid.Row="0" Grid.Column="1" Name="cmbReportType" Text="{Binding CurrentEntity.ReportType}"/&gt;
              &lt;Button Grid.Row="0" Grid.Column="2" Name="btnAddDetail" Content="Add Details" Command="{Binding AddDetailsCommand}"/&gt;
          &lt;/Grid&gt;           
  
          &lt;TextBox Grid.Row="0" Grid.Column="1" Margin="5,5,0,0" Width="190" Name="txtDocName" Text="{Binding CurrentEntity.RefName}"/&gt;
          &lt;TextBox Grid.Row="1" Grid.Column="1" Margin="5,5,0,0" Width="190" Height="75" Name="txtDocAddress" Text="{Binding CurrentEntity.RefAddress}"/&gt;
          &lt;TextBox Grid.Row="2" Grid.Column="1" Margin="5,5,0,0" Width="190" Height="100" Name="txtEntryNote" Text="{Binding CurrentEntity.EntryNotes}"/&gt;
  
          &lt;Custom:DatePicker Grid.Row="3" Grid.Column="1" Margin="5,3,0,0" Width="125" Name="dtpJoinDate" Height="24" HorizontalAlignment="Left" VerticalAlignment="Top" SelectedDate="{Binding CurrentEntity.DateStarted}" SelectedDateFormat="Short"/&gt;
  
          &lt;TextBox Grid.Row="4" Grid.Column="1" Height="25" Width="75" Name="txtDefaultDiscount" HorizontalAlignment="Left" Margin="5,0,0,0" VerticalAlignment="Top" Text="{Binding CurrentEntity.DefaultDiscount}"/&gt;
  
          &lt;Custom:DatePicker Grid.Row="5" Grid.Column="1" Margin="5,3,0,0" Width="125" Name="dtpValidTill" Height="24" HorizontalAlignment="Left" VerticalAlignment="Top" SelectedDate="{Binding CurrentEntity.DefaultDiscountValidTill}" SelectedDateFormat="Short"/&gt;
  
          &lt;ComboBox Grid.Row="6" Grid.Column="1" Margin="5,3,0,0" Width="190" Height="30" Name="cmbEmployeeName" ItemsSource="{Binding Employees}" DisplayMemberPath="FullName" SelectedIndex="{Binding SelecteIndex}"&gt;
  
          &lt;/ComboBox&gt;
  
          &lt;Custom:DataGrid Grid.Row="8" Grid.Column="0" Grid.ColumnSpan="2" ItemsSource="{Binding XYZ}" AutoGenerateColumns="False" Name="grdTestDept"&gt;
              &lt;Custom:DataGrid.Columns&gt;
                  &lt;Custom:DataGridTextColumn Binding="{Binding dep_id}" Width="40" Header="ID"/&gt;
                  &lt;Custom:DataGridTextColumn Binding="{Binding dep_name}" Width="125" Header="Name"/&gt;
                  &lt;Custom:DataGridTextColumn Binding="{Binding default_data}" Width="100" Header="Default Data"/&gt;
              &lt;/Custom:DataGrid.Columns&gt;
          &lt;/Custom:DataGrid&gt;
  
      &lt;/Grid&gt;
  
      &lt;Grid Grid.Row="0" Grid.Column="1" Grid.RowSpan="9"&gt;
  
          &lt;Grid.ColumnDefinitions&gt;
              &lt;ColumnDefinition Width="Auto" MinWidth="43"&gt;&lt;/ColumnDefinition&gt;
              &lt;ColumnDefinition Width="Auto" MinWidth="150"&gt;&lt;/ColumnDefinition&gt;
              &lt;ColumnDefinition Width="Auto" MinWidth="50"&gt;&lt;/ColumnDefinition&gt;
          &lt;/Grid.ColumnDefinitions&gt;
  
          &lt;Grid.RowDefinitions&gt;
              &lt;RowDefinition Height="34*" &gt;&lt;/RowDefinition&gt;
              &lt;RowDefinition Height="337.88*"&gt;&lt;/RowDefinition&gt;
          &lt;/Grid.RowDefinitions&gt;
  
          &lt;TextBlock Text="Name: " Grid.Row="0" Grid.Column="0" Margin="5,4,0,0" /&gt;
  
          &lt;cc:ValueEnabledCombo Grid.Column="1" x:Name="cmbfilEmployeeName" Width="150" Height="30" Margin="5,4,0,0" VerticalAlignment="Top" SelectedIndex="0"
               ItemsSource="{Binding Employees}" DisplayMemberPath="FullName" SelectedValuePath="EmployeeId" cc:ValueEnabledCombo.SelectionChanged="{Binding SelectionChangedCommand}"&gt;
  
          &lt;/cc:ValueEnabledCombo&gt;
  
          &lt;Button Grid.Column="2" Name="btnReport" Width="50" Content="Report" Height="28" Margin="5,4,0,0" Command="{Binding ReportCommand}" VerticalAlignment="Top" /&gt;
              &lt;Grid Grid.Row="1"  Grid.Column="0" Grid.ColumnSpan="3"&gt;
  
                  &lt;Custom:DataGrid  ItemsSource="{Binding DoctorList}" AutoGenerateColumns="False" Name="grdDoctor" ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Auto"&gt;
                      &lt;Custom:DataGrid.Columns&gt;
                          &lt;Custom:DataGridTextColumn Binding="{Binding RefName}" Width="Auto" Header="Doctor Name"/&gt;
                          &lt;Custom:DataGridTextColumn Binding="{Binding EmployeeFullName}" Width="Auto" Header="Employee Name"/&gt;
                      &lt;/Custom:DataGrid.Columns&gt;
                  &lt;/Custom:DataGrid&gt;                    
               &lt;/Grid&gt;
      &lt;/Grid&gt;       
  &lt;/Grid&gt;
  </code></pre>
  
  <p></p>