DataGridViewCombobox是经常使用的控件,但是有一个不便之处就是用户不能自己输入开头的内容,然后自动匹配出合适的结果,结果用户的体验非常不好。
所以查了不少资料,才有了如下的解决办法,代码示例如下:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WinInventory.Forms.Exchange
{
public partial class FmExchange : Form
{
public FmExchange()
{
InitializeComponent();
}
private AutoCompleteStringCollection scAutoComplete = new AutoCompleteStringCollection();
private void tbWarehouseBindingNavigatorSaveItem_Click(object sender, EventArgs e)
{
this.Validate();
this.tbWarehouseBindingSource.EndEdit();
th