[]
Gets or sets a value indicating whether the controls within the designer are locked, preventing modifications.
public bool LockControls { get; set; }
Type | Description |
---|---|
bool |
|
When set to true
, this property prevents any modifications to the controls' properties, size, or position within the designer, effectively
making the design surface read-only. This is useful in scenarios where the design of the report is finalized and should not be altered.
The sample below opens a Windows Form with the designer, featuring a pre-built report. Users can modify certain properties of existing controls, but changing the report layout-specifically the position or size of report items-is not possible.
class TweakSalesReportForm : Form
{
public TweakSalesReportForm()
{
var designer = new Designer { Dock = DockStyle.Fill };
var propertyGrid = new PropertyGrid() { Dock = DockStyle.Right };
designer.LoadReport(new FileInfo("c:\\reports\\Sales.rdlx"));
designer.PropertyGrid = propertyGrid;
designer.LockControls = false;
Controls.Add(designer);
Contorls.Add(propertyGrid);
}
}