private void dataGridView1_CellEndEdit(object sender, DataGridViewCellEventArgs e) { try { datos = new ArrayList(); for (int i = 0; i < dgvDatos.RowCount - 1; i++) { if (dgvDatos.Rows[i].Cells[0].Value.ToString() != null) { datos.Add(Double.Parse(dgvDatos.Rows[i].Cells[0].Value.ToString())); } } datos.Sort(); desc = new Descriptiva(datos, ""); txtLi.Text = datos[0].ToString(); txtLs.Text = datos[dgvDatos.RowCount - 2].ToString(); txtamplitud.Text = desc.Amplitud().ToString(); txtclases.Text = desc.Clases().ToString(); txtanchoc.Text = desc.AnchoClase().ToString(); txtmenor.Text = "Menor: " + datos[0].ToString(); txtmayor.Text = "Mayor: " + datos[dgvDatos.RowCount - 2].ToString(); txtcantidad.Text = "Cantiad: " + (dgvDatos.RowCount - 1).ToString(); txtmedia.Text = "Media: " + Math.Round(desc.Media(), 2); txtmediana.Text = "Mediana: " + desc.Mediana().ToString(); txtmoda.Text = "Moda: " + desc.Moda().ToString(); } catch (Exception) { } }
private void button1_Click(object sender, EventArgs e) { try { string variable = txtvariable.Text; //int clases = int.Parse(txtclases.Text); desc = new Descriptiva(datos, variable); if (dashboard == null) { dashboard = new frmDashboard(datos, variable); dashboard.FormClosed += new FormClosedEventHandler(CerrarForm); dashboard.Show(); } else { dashboard.Activate(); } } catch (Exception) { } }
public frmDashboard(ArrayList datos, String variable) { InitializeComponent(); desc = new Descriptiva(datos, variable); }