title: WPF Datagrid column count is 0
body: <pre><code> *string connStr = ConfigValues.connectionString;
   string query = "select * from table";
   using (OdbcConnection conn = new OdbcConnection(connStr))
  {
     using (OdbcDataAdapter adapter = new OdbcDataAdapter(query, conn))
     {
              ds_sc = new DataSet();
              adapter.Fill(ds_sc);
     }
  }
  
  table_sc = ds_sc.Tables[0];
  datagrid.ItemsSource = table_sc.DefaultView;
  
  MessageBox.Show("count=" + dgvScripture.Columns.Count().ToString());
  
  datagrid.Columns[1].Visibility = Visibility.Hidden;**
  </code></pre>
  
  <p>This WPF datagrid has 3 columns.
  The datagrid column count is zero and im not able to hide the column[1].
  I will need to retrieve the column 1 value later in code. 
  The error I get is : "Index outside bounds"
  Cant find what im missing</p>
  
  <p>Pls help ! Thanks in advance</p>