如何从数据网格中选择数据并以表格形式输入 [英] how to select data from datagrid and enter in a form

查看:70
本文介绍了如何从数据网格中选择数据并以表格形式输入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我是Windows应用程序开发的新手.我在从数据网格中选择列并将其文本显示在表单文本框中时遇到问题.


i m novice in window application development. i have problem in selecting column from a datagrid and showing its text in form textboxes.
can anybody help me out of this problem.

推荐答案

如果您的Column包含一些行,则可以使用Cell_Enter事件获取其值.

If your Column contains some rows, then you can use the Cell_Enter event to get its value.

private void DataGridView1_CellEnter(object sender, DataGridViewCellEventArgs e)
{
textbox1.Text = DataGridView1.CurrentCell.Value.ToString();
}


这篇关于如何从数据网格中选择数据并以表格形式输入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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