Raised when the layout is changing and passes the sender a new EventArgs class called LayoutChangingArgs.
Syntax
Event Data
The event handler receives an argument of type LayoutChangingArgs containing data related to this event. The following LayoutChangingArgs properties provide information specific to this event.
| Property | Description |
|---|
| AllowChange | Sets or returns a value indicating whether to allow the change. |
| Name | The array of names of the controls or sections to be updated or changed. |
| NewSectionName | Gets the name of the new section. |
| NewValue | The array of controls or sections to be added. |
| OldSectionName | Gets the name of the old section. |
| OldValue | The array of controls or sections to be deleted. |
| Type | Returns the type of layout change that is to occur. |
Example
| Visual Basic | Copy Code |
|---|
Private Sub ardMain_LayoutChanging(ByVal sender As Object, ByVal e As Design.LayoutChangingArgs) Handles ardMain.LayoutChanging
If e.Type = Design.LayoutChangeType.SectionDelete Then
Dim Result As DialogResult
Result = MessageBox.Show("Are you sure you want to delete this section?", "Delete?", MessageBoxButtons.OKCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1)
If Result = DialogResult.Cancel Then
e.AllowChange = False
Else
e.AllowChange = True
End If
End If
End Sub
|
| C# | Copy Code |
|---|
private void ardMain_LayoutChanging(object sender, DataDynamics.ActiveReports.Design.LayoutChangingArgs e)
{
if (e.Type == Design.LayoutChangeType.SectionDelete)
{
DialogResult Result;
Result = MessageBox.Show("Are you sure you want to delete this
section?", "Delete?", MessageBoxButtons.OKCancel, MessageBoxIcon.Question,
MessageBoxDefaultButton.Button1);
if (Result == DialogResult.Cancel)
{
e.AllowChange = false;
}
else
{
e.AllowChange = true;
}
}
} |
See Also