在DataGridView中需要一个DropDownList. [英] Need a DropDownList in a DataGridView.

查看:274
本文介绍了在DataGridView中需要一个DropDownList.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当在DataGridView单元格中键入文本时,我想从数据库中弹出DropDownList.类似于TextBoxAutoCompleteMode属性中的Suggest.我可以使用DataGridViewComboBoxColumn来执行此操作,但是无法键入它,除非我单击它,否则DropDownList会弹出.

所以我想知道还有其他方法吗?

I want to popup a DropDownList with the items from the Database, when text typed in a cell of DataGridView. Similar to the Suggest in AutoCompleteMode property of a TextBox. I''m abled to do this using DataGridViewComboBoxColumn but could not type in it and the DropDownList does popup unless I click on it.

So I would like to know is there any alternative way?

推荐答案

用一个简单的例子来解决问题.

使用C#.net Windows应用程序在DataGridView中自动完成组合框
Got the solution with a simple example.

AutoComplete ComboBox in DataGridView using C#.net Windows Application


asp:TemplateField HeaderText="Status">
                    <itemtemplate>
                        <asp:DropDownList ID="ddlstatus" runat="server" Height="16px" Width="55px">
                            <asp:ListItem>InActive
                            <asp:ListItem>Active
                        
                    </itemtemplate>



在设计中,您可以实现此目标.


问候,

Anilkumar.d



In design You Implement This.


Regards,

Anilkumar.d


您使用DataGridview.在属性中,选择Coloums.EditColoumns窗口将打开.单击Add按钮将打开一个窗口.您将获得Add Coloumn窗口.在其中获得一个DropDownList,您将获得DataGridviewButton Coloumn,DtaGridViewCheckBoxColoumn,DataGridView ComboBoxColoumn.您可以选择ComboBoxColoumn.



问候,

AnilKumar.D
You Take DataGridview.In Properties you Select Coloums.EditColoumns Window Will Open.There You Click Add Button One Window Will Open.And You Will get Add Coloumn Window.There You Will Get One DropDownList In That you will get DataGridviewButton Coloumn,DtaGridViewCheckBoxColoumn,DataGridView ComboBoxColoumn.You Can Select ComboBoxColoumn.



Regards,

AnilKumar.D


这篇关于在DataGridView中需要一个DropDownList.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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