在GridView中自动完成 [英] Auto completion in gridview

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

问题描述

我正在设计一个使用datagridview的账单支付系统,我想在datagridview中包括自动完成功能.请提供帮助.

谢谢.

解决方案

在这里是一个简单的文本框示例,其中包含自定义来源"项列表作为自动完成列表. >
请参阅下面的设计器代码,其中定义了"AutoCompleteCustomSource.AddRange()",您可以在此添加任何列表.

  .textBox1 =  System.Windows.Forms.TextBox() ;
             .SuspendLayout();
            //  
            //  textBox1 
            //  
             .textBox1.AutoCompleteCustomSource.AddRange( 字符串 [] {
            " " " " " " " });
             .textBox1.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest;
             .textBox1.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource;
             .textBox1.Location =  System.Drawing.Point( 43  57 );
             .textBox1.Name = " ;
             .textBox1.Size =  System.Drawing.Size( 100  20 );
             .textBox1.TabIndex =  0 ; 


I am designing a bill payment system using a datagridview and I want to include autocomplete feature in datagridview. Please provide assistance.

Thank you.

解决方案

Here''s a simple example of a text box having a "custom source" list of items to use as the auto complete list.

See the designer code below, where it defines "AutoCompleteCustomSource.AddRange()" well you can add any list to this.

this.textBox1 = new System.Windows.Forms.TextBox();
            this.SuspendLayout();
            //
            // textBox1
            //
            this.textBox1.AutoCompleteCustomSource.AddRange(new string[] {
            "Red",
            "Orange",
            "Yellow",
            "Green",
            "Blue",
            "Indigo",
            "Violet"});
            this.textBox1.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest;
            this.textBox1.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource;
            this.textBox1.Location = new System.Drawing.Point(43, 57);
            this.textBox1.Name = "textBox1";
            this.textBox1.Size = new System.Drawing.Size(100, 20);
            this.textBox1.TabIndex = 0;


这篇关于在GridView中自动完成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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