Windows Develop Bookmark and Share   
 index > Windows Forms General > Change a datagridview with data from a dialogform
 

Change a datagridview with data from a dialogform

Hi

I have a little tool with a main form (including a datagridview and a button).
I the user clicks on it a dialog form appears and the user can edit some data.
After closing the dialog form with ok - the datagridview should be updated with
the data from the dialog form.

But I have no access from the ok method of the dialog form to the data grid view
method of form 1.

How can I change the datagridview automatically if the user clicks the OK-button
of the dialog form?

Codeschubser  Saturday, September 19, 2009 2:00 PM
EditForm form = new EditForm();
DialogResult dr = from.ShowDialog();

Setting the DialogResult property of a form will close it, and set the value of the property!

Rudedog =8^D
Mark the best replies as answers. "Fooling computers since 1971."
  • Marked As Answer byCodeschubser Saturday, September 19, 2009 2:38 PM
  •  
Rudedog2  Saturday, September 19, 2009 2:13 PM
EditForm form = new EditForm();
DialogResult dr = from.ShowDialog();

Setting the DialogResult property of a form will close it, and set the value of the property!

Rudedog =8^D
Mark the best replies as answers. "Fooling computers since 1971."
  • Marked As Answer byCodeschubser Saturday, September 19, 2009 2:38 PM
  •  
Rudedog2  Saturday, September 19, 2009 2:13 PM
Ok, that works. Thanks :)
Codeschubser  Saturday, September 19, 2009 2:39 PM

You can use google to search for other answers

Custom Search

More Threads

• MDIChildren Forms Activation is not working properly
• Windows forms timer
• Control BackColor Transparent Issues..
• Printer Question
• Do you have to call Form.Dispose()
• Services strange problem
• checkbox problems
• ComboBox / DataGridView Problem
• GraphicsPath.AddBeziers(Point[] pts) throws ArgumentException
• What does the 'tilde' + 1 mean? (eg C:\Docume~1\)