Reputation: 387
I have a User Control displaying some data and a button that displays a popup that allows the user to add data. Then the users enters the data and clicks OK and the pop-up closes. The problem is that the form still displays the old data. To what event should I wire DataReload()
to see the change immediately?
Upvotes: 0
Views: 76
Reputation: 10650
Handle the FormClosed event of your popup:
popUp.FormClosed += (o, e) => DataReload();
Upvotes: 1
Reputation: 57892
What is the "popup"? A dialog?
If it is shown modally with ShowDialog(), then it will not return until the user hits OK and it returns its result, so you can just call DataReload() right afterwards, as in:
MyDialog dlg = new MyDialog();
if (dlg.ShowDialog() == DialogResult.OK)
{
DataReload();
}
Upvotes: 0