به طور متوسط روزی یک بار ازین سوالات پرسیده میشه!
//in form 1:
private void button1_click(/*...*/)
{
form2 f=new form2();
f.ShowDioalog();
txtSelectedRow.Text=f.SelectedString;
DataGridViewRow dr=f.SelectedRow;
//now use dr,...
}
//
//in form 2:
//
// u need some properties:
public string SelectedString{get;set;}
public DataGridViewRow SelectedRow{get;set;}
private void datagrid1_SelectionChange(/*...*/)
{
if(datagrid1.CurrentRow!=null)
{
this.SelectedString=datagrid1.CurrentRow.Cells[0].Value.ToString();
this.SelectedRow=datagrid1.CurrentRow;
}
}
//please don't ask again about this questions...