private void Refreshi() { dataGridView1.Rows.Clear(); List <Tuple <int, string, string> > tmp = new List <Tuple <int, string, string> >(); tmp = us.GetAllUsers(textBox1.Text, textBox2.Text, textBox3.Text); if (tmp.Count != 0) { dataGridView1.RowCount = tmp.Count(); for (int i = 0; i < us.GetAllUsers(textBox1.Text, textBox2.Text, textBox3.Text).Count; i++) { dataGridView1[0, i].Value = tmp[i].Item1; dataGridView1[1, i].Value = tmp[i].Item2; dataGridView1[2, i].Value = tmp[i].Item3; } } }