/// <summary> /// Update DataGridView with Selected User. /// </summary> /// <param name="id">ID from selected user.</param> private void RefreshDataGrid(int id) { try { // Get List of Posts List <Posts> userPosts = sendRequest.RequestPostsByUser(id); dataGridViewAlbums.DataSource = null; // Fill datagridview dataGridViewAlbums.DataSource = userPosts; } catch (Exception ex) { MessageBox.Show("Exception: " + ex.Message + "\nSource : " + ex.Source, "Erro", MessageBoxButtons.OK, MessageBoxIcon.Error); } }