title: While getting a cell value in row am getting error Object reference not set to Instance of Object
body: <p>Am trying to get focused row cell value and previous row cell value of focused row. I used this code</p>
  
  <p><code>object eachprice = gridView1.GetRowCellValue(gridView1.FocusedRowHandle,gridView1.Columns["Price"]);</code></p>
  
  <p>this code get the value of price in focused row </p>
  
  <pre><code>object eachprice = gridView1.GetRowCellValue(gridView1.FocusedRowHandle-1, gridView1.Columns["Price"]);
  </code></pre>
  
  <p>but this code didn't get the cell value of previous row. it show null value so i get error "Object reference not set to instance of Object"</p>
  
  <p>this is my code</p>
  
  <pre><code>private void discountcol()
      {
  
          if ((getdisc == tempstr) &amp;&amp; (rownumber &gt;= 1))
          {
              int focusedcount = gridView1.FocusedRowHandle;
  
              t1.Text = "";
              t1.Text = getdisc;
  
              object eachprice = gridView1.GetRowCellValue(focusedcount-1, gridView1.Columns["Price"]);
              t2.Text = eachprice.ToString();
  
              if (!(t2.Text == string.Empty))
              {
                  decimal pricedecimal = Convert.ToDecimal(t2.Text);
                  object eachdiscount = gridView1.GetRowCellValue(gridView1.FocusedRowHandle, gridView1.Columns["Price"]);
                  decimal eachdisdecimal = Convert.ToDecimal(eachdiscount);
                  decimal tempdiscountprice = -(pricedecimal * (eachdisdecimal / 100));  // -ve calculation
                  t3.Text = tempdiscountprice.ToString("N2");
  
                  gridView1.SetRowCellValue(gridView1.FocusedRowHandle, gridView1.Columns["Price"], t3.Text);
  
                  if (getdisc == tempstr)
                  {
                      PricQuan.UnboundType = DevExpress.Data.UnboundColumnType.Decimal;
                      PricQuan.UnboundExpression = " 1 * [Price]";
  
                      TaxinAmount.UnboundType = DevExpress.Data.UnboundColumnType.Decimal;
                      TaxinAmount.UnboundExpression = " ([Price] * ([TaxInPercentage] / 100.0)) * 1 ";
                  }
                  else
                  {
                      //PricQuan.UnboundType = DevExpress.Data.UnboundColumnType.Decimal;
                      //PricQuan.UnboundExpression = " Round([Quantity] * [Price], 2)";
  
                      //TaxinAmount.UnboundType = DevExpress.Data.UnboundColumnType.Decimal;
                      //TaxinAmount.UnboundExpression = " ([Price] * ([TaxInPercentage] / 100.0)) * [Quantity] ";
                  }
  
              }
  
          }
          else
          {
  
          }
      }
  </code></pre>