I would expect this would be a common need. Can anyone help or point me to a page that explains how to do this?
Asked
Active
Viewed 819 times
3
-
Can you provide more details? Maybe a code snippet or two ... – deadbug Mar 23 '09 at 08:18
2 Answers
2
If you mean like the auto-complete options on TextBox
, I'm not aware of any in-built support for this. The closest (although not the same) would be to use a DataGridViewComboBoxColumn
.
For things not directly available; it looks like other people have looked at this - you might try the sample here.

Marc Gravell
- 1,026,079
- 266
- 2,566
- 2,900
0
If you mean that getting data of dataGridView from database with textbox button textChanged event do this.
private void textBox1_TextChanged(object sender, EventArgs e)
{
string query = "select Emp_ID,Emp_Name,Father_Name,Email from Employee where Emp_Name like '" + textBox1.Text + "%' ORDER BY Emp_Name ASC";
using (SqlCommand comand = new SqlCommand(query, con))
{
SqlDataAdapter da = new SqlDataAdapter();
da.SelectCommand = comand;
DataTable ds = new DataTable();
ds.Locale = System.Globalization.CultureInfo.InvariantCulture;
da.Fill(ds);
dataGridView1.DataSource = ds;
}
}

Wajahat
- 1
- 6