private void LlenarGridProveedor() { DataTable dt = new DataTable(); if (rbActivo.Checked) { P.Estado = true; } else if (rbInactivo.Checked) { P.Estado = false; } dt = P.Listar(); try { dtgEmpleado.Rows.Clear(); for (int x = 0; x < dt.Rows.Count; x++) { dtgEmpleado.Rows.Add(dt.Rows[x][0]); dtgEmpleado.Rows[x].Cells[1].Value = dt.Rows[x][0].ToString(); dtgEmpleado.Rows[x].Cells[2].Value = dt.Rows[x][1].ToString(); dtgEmpleado.Rows[x].Cells[3].Value = dt.Rows[x][2].ToString(); dtgEmpleado.Rows[x].Cells[4].Value = dt.Rows[x][3].ToString(); dtgEmpleado.Rows[x].Cells[5].Value = dt.Rows[x][4].ToString(); dtgEmpleado.Rows[x].Cells[6].Value = dt.Rows[x][5].ToString(); dtgEmpleado.Rows[x].Cells[7].Value = dt.Rows[x][6].ToString(); dtgEmpleado.Rows[x].Cells[8].Value = dt.Rows[x][7].ToString(); } dtgEmpleado.ClearSelection(); } catch (Exception ex) { MessageBoxEx.Show(ex.Message, "FactSYS", MessageBoxButtons.OK, MessageBoxIcon.Information); } }