private void Development_CellValueChanging(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e)
 {
     if (e.Column.Name.ToString() == "gcDevLocked")
     {
         DataRow dr = Development.GetFocusedDataRow();
         dr["locked"] = e.Value;
         if (Convert.ToBoolean(e.Value))
         {
             //dr["Lkg"] = dr["Pkg"];
             //dr["Diffkg"] = 0;
             dr["Lock_On_M"] = dr["Plan_On_M"];
             dr["diffm3"]    = 0;
             // dr["Lcmgt"] = dr["Pcmgt"];
             //dr["LSQM"] = dr["PSQM"];
             dr["lM"]         = dr["metresadvance"];
             dr["Lock_Off_M"] = dr["Plan_Off_M"];
             dr["diffoffm"]   = 0;
             dr["diffm2"]     = 0;
             dr["LUkg"]       = dr["PUkg"];
             dr["DiffUkg"]    = 0;
         }
         else
         {
             //dr["Lkg"] = 0;
             //dr["Diffkg"] = Convert.ToDecimal(dr["Pkg"].ToString()) - Convert.ToDecimal(dr["Lkg"].ToString());
             dr["Lock_On_M"] = 0;
             dr["diffm3"]    = Convert.ToDecimal(dr["Plan_On_M"].ToString()) - Convert.ToDecimal(dr["Lock_On_M"].ToString());
             //  dr["Lcmgt"] = 0;
             //dr["LSQM"] = 0;
             dr["lM"]         = 0;
             dr["Lock_Off_M"] = 0;
             dr["diffoffm"]   = Convert.ToDecimal(dr["Plan_Off_M"].ToString()) - Convert.ToDecimal(dr["Lock_Off_M"].ToString());
             dr["diffm2"]     = Convert.ToDecimal(dr["metresadvance"].ToString()) - Convert.ToDecimal(dr["lM"].ToString());
             dr["LUkg"]       = 0;
             dr["DiffUkg"]    = Convert.ToDecimal(dr["PUkg"].ToString()) - Convert.ToDecimal(dr["LUkg"].ToString());
         }
     }
 }