private async void AtualizaGridByFiltro() { responsaveis = await HttpResponsaveis.GetResponsavelsBySearch(txtFiltro.Text, usuarioLogado.token); dgvEscolas.Rows.Clear(); foreach (var responsavel in escolas) { int n = dgvEscolas.Rows.Add(); } }
private async void dgvEscolas_CellClick(object sender, DataGridViewCellEventArgs e) { idEscola = Convert.ToInt64(dgvEscolas.Rows[e.RowIndex].Cells["colIdEscola"].Value); txtNomeEscola.Text = dgvEscolas.Rows[e.RowIndex].Cells[0].Value.ToString(); txtLogradouro.Text = dgvEscolas.Rows[e.RowIndex].Cells[1].Value.ToString(); txtBairro.Text = dgvEscolas.Rows[e.RowIndex].Cells[2].Value.ToString(); txtCep.Text = dgvEscolas.Rows[e.RowIndex].Cells[3].Value.ToString(); txtNumero.Text = dgvEscolas.Rows[e.RowIndex].Cells[4].Value.ToString(); txtCidade.Text = dgvEscolas.Rows[e.RowIndex].Cells[5].Value.ToString(); cboEstado.Text = dgvEscolas.Rows[e.RowIndex].Cells[6].Value.ToString(); responsaveis = await HttpResponsaveis.GetResponsavelsBySearch(dgvEscolas.Rows[e.RowIndex].Cells[0].Value.ToString(), usuarioLogado.token); dgvResponsavel.Rows.Clear(); foreach (var item in responsaveis) { dgvResponsavel.Rows.Add(item.Nome, item.Email, item.Cargo, "Remover", item.Id); } }