private void ProcesarDatosHoja() { DataTable dt; dt = PlanillaDeCalculo.leerDatosHoja(this.openFileDialogArchivo.FileName, this.lstHojas.SelectedItem.ToString()); this.dgvDatos.DataSource = dt; Controles.setEstandarDataGridView(this.dgvDatos); }
private void btnSeleccionarArchivo_Click(object sender, EventArgs e) { DataTable dt; openFileDialogArchivo.Filter = "Excel XLS (*.xls)|*.xls"; openFileDialogArchivo.FileName = ""; if (openFileDialogArchivo.ShowDialog() == DialogResult.OK) { dt = PlanillaDeCalculo.leerEsquemaLibro(this.openFileDialogArchivo.FileName); this.lstHojas.Items.Clear(); int i = 0; while (i < dt.Rows.Count) { this.lstHojas.Items.Add(dt.Rows[i].ItemArray[2].ToString()); i++; } this.lstHojas.SetSelected(0, true); //selecciona el primer registro this.pbFichadas.Value = 0; this.btnActualizar.Enabled = true; } }