Click here to Skip to main content
15,881,248 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
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.
Posted
Updated 26-Jan-13 6:51am
v2
Comments
[no name] 27-Jan-13 3:54am    
so...??? why not start executing it??

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
C#
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;
}
 
Share this answer
 
v2
Thanks everyone very much.........I've solved my problem
 
Share this answer
 
Thanks everyone, I had solved my problem :D
 
Share this answer
 
Comments
CuongPuyol 10-Apr-13 6:23am    
Thanks everyone very much.........I've solved my problem

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900