private async void SearchUserButton_Click(object sender, EventArgs e) { try { AuthenticationServiceClient client = new AuthenticationServiceClient(); string roleName = comboBoxRole.Text; if (roleName.ToLower().Equals("all roles")) { roleName = ""; } Form frm = new ProgressForm(); frm.Show(); User[] users = await client.SearchUserAsync(textBoxLogin.Text, textBoxFullName.Text, roleName); frm.Close(); dataGridViewSearch.DataSource = new BindingList <ClientUser>(users.Select(user => new ClientUser(user)).ToList()); if (users.Length == 0) { MessageBox.Show("Users not found!"); } } catch (FaultException exc) { MessageBox.Show(exc.Message); } }