问问解决了一个问题 [英] to asked solved a problem

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

问题描述

你好我是罗希特...
我正在用C#开发Windows应用程序,当我单击dataGridView单元格时,dataGridView单元格中的记录将显示在Windows窗体的文本框控件上,这样我就会遇到问题....
请告诉我如何执行此任务....
回复我正在等待.....

hello i m rohit ...
i am devoloping windows application in C# i want , when i will be click on dataGridView cell the record in the cell of dataGridView will be show on the textbox control of the windows form so that i will have problem ....
please tell me how to do this task ....
Reply i am waiting.....

推荐答案

处理DataGridView SelectionChanged事件:
Handle the DataGridView SelectionChanged event:
private void myDataGridView_SelectionChanged(object sender, EventArgs e)
    {
    if (myDataGridView.SelectedCells.Count > 0)
        {
        myTextBoxToHoldTheData.Text = myDataGridView.SelectedCells[0].Value.ToString();
        }
    }


这篇关于问问解决了一个问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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