title: Getting data from data grid view cells
body: <p>I am trying to get data from cells from my dataGridView in windows form, bu keep getting this error:
  'System.Windows.Forms.DataGridViewCell' does not contain a definition for 'Text'... (are you missing a using directive or an assembly reference?). I use the same method in a gridwiev in a related asp.net web forms applicatio, so why does it not work here? Data in datagridview is from a database.</p>
  
  <pre><code>                  new Rectangle
                {
                    Height = Convert.ToInt32(dataGridView1.Rows[i].Cells[2].Text),
                    Width = Convert.ToInt32(dataGridView1.Rows[i].Cells[3].Text),
                    X = 0,
                    Y = 0,
                };
  </code></pre>