In C #, how to add Intellisense to DataGridView cells?

I expect this to be a common need. Can someone help or point me to a page explaining how to do this?

+3
source share
2 answers

If you mean autocomplete options on TextBox, I don't know any built-in support for this. The closest (though not the same) would be to use DataGridViewComboBoxColumn.

For things that are not directly available; it looks like other people looked at this - you can try the sample here .

+2
source

, dataGridView textbox textChanged .

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;
}
} 
0

Source: https://habr.com/ru/post/1705166/


All Articles