# GrapeCity.ActiveReports.Design.Designer.LayoutChanged

## Content

<div class="doc-site-dotnet-api-container">




<h1 id="GrapeCity_ActiveReports_Design_Designer_LayoutChanged" data-uid="GrapeCity.ActiveReports.Design.Designer.LayoutChanged" class="text-break">LayoutChanged Event
</h1>
<div class="markdown level0 summary"><p>Occurs after the report layout has been modified. This event signifies a permanent change in the layout.</p>
</div>
<div class="markdown level0 conceptual"></div>
<h6><strong>Namespace</strong>: <a class="xref" href="GrapeCity.ActiveReports.Design.html">GrapeCity.ActiveReports.Design</a></h6>
<h6><strong>Assembly</strong>: MESCIUS.ActiveReports.Design.Win.dll</h6>
<h5 id="GrapeCity_ActiveReports_Design_Designer_LayoutChanged_syntax">Syntax</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public event LayoutChangedEventHandler LayoutChanged</code></pre>
</div>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="GrapeCity.ActiveReports.Design.LayoutChangedEventHandler.html">LayoutChangedEventHandler</a></td>
      <td>Occurs after the report layout has been modified. This event signifies a permanent change in the layout.</td>
    </tr>
  </tbody>
</table>
<h5 id="GrapeCity_ActiveReports_Design_Designer_LayoutChanged_remarks"><strong>Remarks</strong></h5>
<div class="markdown level0 remarks"><p>This event is triggered once changes to the report's layout are finalized, such as after moving, adding, or deleting report elements. It serves as a
notification that the layout has been altered in a way that cannot be undone without further actions by the user or programmatic interventions.</p>
<p>Event handlers can use this opportunity to perform tasks that need to occur after a layout change, such as updating UI elements, saving the report, 
or refreshing previews.</p>
</div>
<h5 id="GrapeCity_ActiveReports_Design_Designer_LayoutChanged_examples"><strong>Examples</strong></h5>
<p>This example shows how to perform specific actions immediately after the report layout has changed.</p>
<pre><code class="lang-csharp">designer.LayoutChanged += (sender, args) =&gt; {
	// Example action: Log a message indicating the layout change.
	Console.WriteLine("The report layout has been changed.");
	// Additional actions can be performed here.
};</code></pre>
<p>Use this event to handle report layout changes. The following example prevents the addition of new controls until the report has a data set:</p>
<pre><code class="lang-csharp">designer.LayoutChanging += (sender, args) =&gt; {
	if (args.Type == LayoutChangeType.ControlAdd 
	&amp;&amp; designer.Report is PageReport pageReport 
	&amp;&amp; pageReport.Report.DataSets.Count == 0)
	{
		// Use the designer's service provider to get the IUIService and show an error message.
		((IUIService) designer).ShowError("Add data set first.");
		args.AllowChange = false; // Prevent the change.
	}
};</code></pre>

</div>
