private void button3_Click(object sender, RoutedEventArgs e) { var a = this.comingGrild.SelectedItem; var b = a as DataRowView; string id = (Convert.ToInt32(b.Row[0])).ToString(); string name5 = (string)(b.Row[4]); addposition window = new addposition(); window.MyEvent += new ClickEventHandler(form_MyEvent); window.setmessege(id, name5); window.Owner = Window.GetWindow(this); window.ShowDialog(); }