hi
In a form I dropped a datagridview and a contextmenustrip. When I run the form it displays some info from the db to the dgv. The contextmenustrip has a item called open which opens a new form and also carries some variables to that form. My question is when I right click on a particular row then that row's 1st,2nd,and 3rd cell values should be copied to 3 string vars and are passed to the new form

Vimal KandasamyRank #2,151 · 661 reputationPosted May 8, 2009, 5:02 AM EDT
This can be done in two steps add code in cell mouse down event
like
String s1,s2,s3;
Vimal KandasamyRank #2,151 · 661 reputationPosted May 7, 2009, 6:03 AM EDT
in open menu add code like below
String s1=dataGridView1.CurrentRow.Cells[0].Value.ToString(); String s2=dataGridView1.CurrentRow.Cells[1].Value.ToString(); String s3=dataGridView1.CurrentRow.Cells[2].Value.ToString(); //add code to pass these s1,s2,s3 to another form via overloaded constructor.and show that formsachi vasishta180 reputationPosted May 7, 2009, 9:03 PM EDT
sachi vasishta180 reputationPosted May 8, 2009, 5:31 AM EDT
thanks vimal
now it is working exactly in the I was trying.Vimal I tried with all mouse_click events but I have not tried with cellmouse_click,down,etc evnts. Anyway once again thank you.
Vimal I have also posted a form regerding dgv. I am also trying with all properties of dgv but not getting the required scene. If you find ans please reply for that
thanks
Vimal KandasamyRank #2,151 · 661 reputationPosted May 9, 2009, 12:18 AM EDT