Problem with Option Page, Dirty and StatusChanged

Add-in Express™ Support Service
That's what is more important than anything else

Problem with Option Page, Dirty and StatusChanged
Dirty Event doesn't fire anymore after close and reopen options pages 
Eddy MINET




Posts: 4
Joined: 2006-09-26
Here is my actual Code :


private bool PageChanged = false;

...

void CVDOptionPage_Dirty(object sender, addinExpress.VSTO.ADXDirtyEventArgs e) {
            e.Dirty = PageChanged;
}

private void CVDOptionPage_Apply(object sender, EventArgs e) {

    PageChanged = false;
    // Save configuration here

}

void lstFolderDossier_SelectedValueChanged(object sender, EventArgs e) {
            PageChanged = true;
            this.OnStatusChange();
}

private void lstFolderClients_SelectedIndexChanged(object sender, EventArgs e) {
            PageChanged = true;    
            this.OnStatusChange();
}  



This works well the first time I open the option page but if I close and reopen the page, the Dirty event is not raised anymore and it's impossible to enable the Apply button and the Apply event is never raised.
Posted 26 Sep, 2006 11:20:12 Top
Sergey Grischenko


Add-in Express team


Posts: 7235
Joined: 2004-07-05
Hi Eddy.

Thank you for the bug report. I will fix it in the next build.
However you can avoid this issue using the 'this.clientSite = null;' statement. Just add it before the OnStatusChange method.

E.g.

void lstFolderDossier_SelectedValueChanged(object sender, EventArgs e) {
PageChanged = true;
this.clientSite = null;
this.OnStatusChange();
}
Posted 26 Sep, 2006 12:19:49 Top
Eddy MINET




Posts: 4
Joined: 2006-09-26
Thank you very much. It works well now !
Posted 27 Sep, 2006 03:41:28 Top