Event on window close

  • Thread starter Thread starter Manuel
  • Start date Start date
M

Manuel

Hi all,

I have one form which has a dataGrid and a button, as well
as some invisible labels.

When I press the button, a new form is displayed, where
data present in the dataGrid is to be edited (exactly, I
am not editing it on the dataGrid, rather binding the data
to some combos and boxes, allowing edition.

When I finish editing the data, I would like the datagrid
and any constraints applied to the dataGrid to be
reviewed, for instance to display a warning message and
make some buttons inactive, as the data has changed,
obeying to what makes those constraints valid when
executing.

I see some events such as gotFocus() and others, but I
don´t see how can I call the web service that analyses the
constraints when I close the edition window.

I wouldn´t like to have a button saying "refresh"....as I
know this can be done on editionwindow_close.

How can I find out the solution to my problem?

Thanks,

Manuel
 
You can create your child ('PopUp') form as a diaglog box and use the result of the dialog box on the parent.

On the child form set this properties:
btnCancel.DialogResult = DialogResult.Cancel;

btnSelect.DialogResult = DialogResult.OK;

CancelButton = btnCancel;

AcceptButton = btnSelect;

On the parent form:
//open a child form
Childfrom cf = new Childform();

if (cf.ShowDialog(this) == DialogResult.Cancel)

{

do your cancel implementation

}

else

{

do you ok implementation

}

//close your child form

fc.Dispose();



hope this help

Bo Ching



Hi all,

I have one form which has a dataGrid and a button, as well
as some invisible labels.

When I press the button, a new form is displayed, where
data present in the dataGrid is to be edited (exactly, I
am not editing it on the dataGrid, rather binding the data
to some combos and boxes, allowing edition.

When I finish editing the data, I would like the datagrid
and any constraints applied to the dataGrid to be
reviewed, for instance to display a warning message and
make some buttons inactive, as the data has changed,
obeying to what makes those constraints valid when
executing.

I see some events such as gotFocus() and others, but I
don´t see how can I call the web service that analyses the
constraints when I close the edition window.

I wouldn´t like to have a button saying "refresh"....as I
know this can be done on editionwindow_close.

How can I find out the solution to my problem?

Thanks,

Manuel
 
Back
Top