事件单击DatagridView以显示信息 [英] Event Click on DatagridView to show information
本文介绍了事件单击DatagridView以显示信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我构建一个WinForm应用程序,我有一个表单,其中包括:两个datagridview和两个表有关系。
我从表1中显示信息,然后我想点击datagridview 1的行并显示表2的信息。
要做到这一点,我必须使用数据网格视图的事件吗?
非常感谢。
解决方案
亲爱的CuongPuyol
i在我的项目中使用这种类型的代码我正在为你的项目事件放置示例,如果它对你有用,请检查它
private void gridSrch_DoubleClick( object sender,EventArgs e)
{
cmbitem.Text = gridSrch.Rows [gridSrch.CurrentRow.Index] .Cells [ 0 ]。Value.ToString();
panelSearch.Visible = false ;
}
private void gridSrch_KeyDown( object sender,KeyEventArgs e)
{
cmbitem.Text = gridSrch.Rows [gridSrch.CurrentRow.Index] .Cells [ 0 跨度>] Value.ToString();
panelSearch.Visible = false ;
}
非常感谢大家.........我已经解决了我的问题
谢谢大家,我解决了我的问题:D
Hi everyone,
I build a WinForm application, I have a form which includes: two datagridview and two table have relationship.
I show information from table 1 and then I want to click on row of datagridview 1 and show information of table 2.
To do it, I must use event of data grid view?
Many thanks.
解决方案
Dear CuongPuyol
i use also such type of code in my project i am placing example of my project events for you kindly check it if it is useful for you
private void gridSrch_DoubleClick(object sender, EventArgs e) { cmbitem.Text = gridSrch.Rows[gridSrch.CurrentRow.Index].Cells[0].Value.ToString(); panelSearch.Visible = false; } private void gridSrch_KeyDown(object sender, KeyEventArgs e) { cmbitem.Text = gridSrch.Rows[gridSrch.CurrentRow.Index].Cells[0].Value.ToString(); panelSearch.Visible = false; }
Thanks everyone very much.........I''ve solved my problem
Thanks everyone, I had solved my problem :D
这篇关于事件单击DatagridView以显示信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文