Back to Devexpress

LayoutControl.IsModified Property

windowsforms-devexpress-dot-xtralayout-dot-layoutcontrol-af5d7389.md

latest3.7 KB
Original Source

LayoutControl.IsModified Property

Gets whether the layout has been changed.

Namespace : DevExpress.XtraLayout

Assembly : DevExpress.XtraLayout.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
[Browsable(false)]
public bool IsModified { get; }
vb
<Browsable(False)>
Public ReadOnly Property IsModified As Boolean

Property Value

TypeDescription
Boolean

true if the layout has been changed; otherwise, false.

|

Remarks

The IsModified property indicates whether the layout has been changed.

After the user performs any single layout customization action in Customization Mode (e.g., drags an item to a new position, adds a splitter, renames an item, etc), this property is set to true.

The IsModified property is automatically set to false after the layout has been restored from a file in XML format, a stream or the system registry.

Example

The following example shows how you can perform certain actions after the layout has been modified by an end-user in Customization Mode. The LayoutControl.HideCustomization event is handled to check the value of the LayoutControl.IsModified property and perform these actions.

To reset the IsModified flag to false when the Customization Form is opened, the LayoutControl.ShowCustomization event is handled. The flag is reset via the interface SetIsModified method.

csharp
using DevExpress.XtraLayout;

private void layoutControl1_ShowCustomization(object sender, EventArgs e) {
    //Reset the IsModified flag when opening the Customization Form
    (layoutControl1 as ILayoutControl).SetIsModified(false);
}

private void layoutControl1_HideCustomization(object sender, EventArgs e) {
    if (layoutControl1.IsModified) {
        //Do some actions if the layout was changed
        //...
    }
}
vb
Imports DevExpress.XtraLayout

Private Sub LayoutControl1_ShowCustomization(sender As System.Object, e As System.EventArgs) _
    Handles LayoutControl1.ShowCustomization
    'Reset the IsModified flag when opening the Customization Form
    TryCast(LayoutControl1, ILayoutControl).SetIsModified(False)
End Sub

Private Sub LayoutControl1_HideCustomization(sender As System.Object, e As System.EventArgs) _
    Handles LayoutControl1.HideCustomization
    If LayoutControl1.IsModified Then
        'Do some actions if the layout was changed
        '...
    End If
End Sub

See Also

SaveLayoutToRegistry(String)

SaveLayoutToStream(Stream)

SaveLayoutToXml(String)

LayoutControl Class

LayoutControl Members

DevExpress.XtraLayout Namespace