问题是AutoComplete也会显示第1列以外的列.在第1列中输入文本然后它将开始显示其他列之前,它不会出现.
我的代码:
public AutoCompleteStringCollection ClientListDropDown()
{
AutoCompleteStringCollection asc = new AutoCompleteStringCollection();
try
{
Query = "Select top 5 title from customer "; // just removed where name like '%" + txtDVNo.Text + "%' plz check
cmd = new SqlCommand(Query, GlobalVars.conn);
dr = cmd.ExecuteReader();
if ((dr != null) && (dr.HasRows))
while (dr.Read())
asc.Add(dr.GetValue(0).ToString());
dr.Close();
cmd.Dispose();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
return asc;
}
private void dgvDVDetails_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
{
if (dgvDVDetails.CurrentCell.ColumnIndex == 1)
{
TextBox prodCode …Run Code Online (Sandbox Code Playgroud)