Exemplo n.º 1
0
        private void LlenarGridProveedor()
        {
            DataTable dt = new DataTable();

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