mohammad amrat

mohammad amrat

  • NA
  • 44
  • 1.9k

pass datagridview between two forms

Mar 5 2017 4:45 AM
I want to pass datagridview from this form "itemsManagement" to "editItems" form
public partial class itemsManagement : Form
{
public itemsManagement()
{
InitializeComponent();
this.ActiveForms = new Dictionary();
}
private Dictionary ActiveForms;
private void showform() where TSource : Form
{
Form form = null;
if (this.ActiveForms.ContainsKey(typeof(TSource)))
{
form = this.ActiveForms[typeof(TSource)];
form.WindowState = FormWindowState.Normal;
form.ShowDialog();
}
else
{
form = Activator.CreateInstance();
form.FormClosed += form_FormClosed;
form.ShowDialog();
this.ActiveForms.Add(typeof(TSource), form);
}
}
private void form_FormClosed(object sender, FormClosedEventArgs e)
{
this.ActiveForms.Remove(sender.GetType());
}
private void editItemToolStripMenuItem_Click(object sender, EventArgs e)
this.showform(); 
 please help me 
 

Answers (16)