数据网格视图中的自动完成C#windows表单应用程序 [英] Autocomplete in datagrid view C# windows forms application

查看:59
本文介绍了数据网格视图中的自动完成C#windows表单应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个用于绑定值的数据网格视图,我在这个数据网格视图中有一个组合框,我想在这个组合框中实现一个自动完成属性...它不仅应该搜索第一个信,但整件物品......



我尝试过的事情:



我已经查找了代码,因为组合框在数据网格视图中,我似乎无法找到解决方案

I have a data grid view which is used to bind values, I have a combo box inside this data grid view, I want to implement an auto complete property in this combo box... It should not only search for the first letter but the whole item...

What I have tried:

I have looked for the codes since the combo box is inside the data grid view, I cannot seems to find a solution

推荐答案

你好Sajin



您是否尝试过使用Datagridview的EditingControlShowing事件?



Hi Sajin

Have you tried using EditingControlShowing event of the Datagridview?

if (e.Control is DataGridViewComboBoxEditingControl) //check for the id in case multiple columns with dropdown and you need specific.
            {
                ((ComboBox)e.Control).DropDownStyle = ComboBoxStyle.DropDown;
                ((ComboBox)e.Control).AutoCompleteSource = AutoCompleteSource.ListItems;
                ((ComboBox)e.Control).AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest;
            }







希望这会有所帮助。




Hope this helps.


这篇关于数据网格视图中的自动完成C#windows表单应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆