在键入时在datagridview单元格中的文本框中显示字符串吗? [英] Display the string in textbox in a datagridview cell right while typing?

查看:366
本文介绍了在键入时在datagridview单元格中的文本框中显示字符串吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已将文本框的Text属性绑定到datagridview的列,如下所示:
dataGridView1.DataBindings.Add("Name",textBox1,"Text");
我尝试在文本框中键入一些文本,但是绑定到textBox1的列(名称"列)中单元格的值不能反映文本框中的文本,除非单击当前单元格并移至其他单元格. br/> 在文本框中键入内容时,是否有任何方法可以反映更改?
非常感谢!

I have bound the Text property of a textbox to a column of a datagridview like the following:
dataGridView1.DataBindings.Add("Name", textBox1, "Text");
I have tried typing some text in the textbox but the value of the cell in the column bound to textBox1 (column "Name") didn''t reflect the text in the textbox unless I clicked on the current cell and moved to other.
Is there any way to make it reflect the changes while typing in the textbox?
Thank you so much!

推荐答案

使用TextBox1的Text Change事件或keyup事件将文本值分配给单元格

为什么将TextBox动态添加到网格,可以通过选择在添加列中键入"按钮在列中将列作为textbox列添加到gridview中.
Use Text Change event or key up event of textBox1 to assign text value to cell

Why you Adding TextBox dynamically to grid, You can add column as textbox columns in gridview by selecting the Type in add column button


这篇关于在键入时在datagridview单元格中的文本框中显示字符串吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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