How to fix dock layout.

StatusIDPriorityType
Closed39080MajorQuestion
ProfileReply
MollyClient

Do you have a sample of how I can fix the layout of dockpanels such that users cannot change the dock layout at runtime.am trying to implement this using and same my models in the database.also does the audit module support sqlite or vista db?

Replies

UserDescriptionPosted On
MariyaVoytovichAgent

Hello!

To disable Layout customization for the DockPanel, you need to access the LayoutControl view, which is located on the target panel.
And for LayoutControl.AllowCustomization set to false.
This can be done using the WindowsController.
An example of such a controller:

public class DisableCustomizeLayoutWindowController: WindowController
{
private XafariDockingWindowController _xafariDockingWindowController;
public DisableCustomizeLayoutWindowController():base(){}
protected override void OnFrameAssigned()
{
base.OnFrameAssigned();
this._xafariDockingWindowController = this.Frame.GetController<XafariDockingWindowController>();
if (this._xafariDockingWindowController !=null)
this._xafariDockingWindowController.DockPanelAdded += _xafariDockingWindowController_DockPanelAdded;
}
private void _xafariDockingWindowController_DockPanelAdded(object sender, DockPanelAddedEventArgs e)
{
var panel = e.DockPanel;
panel.ControlsCreated += Panel_ControlsCreated;
}
private void Panel_ControlsCreated(object sender, EventArgs e)
{
var dockPanel = sender as DockPanelItem;
if (dockPanel!= null && dockPanel.Frame.View is DetailView detailView)
{
// Access the Detail View's Control as a Layout Control
DevExpress.XtraLayout.LayoutControl layoutControl =
((DevExpress.XtraLayout.LayoutControl)detailView.Control);
layoutControl.AllowCustomization = false;
}
dockPanel.ControlsCreated -= Panel_ControlsCreated;
}
protected override void OnDeactivated()
{
base.OnDeactivated();
if (this._xafariDockingWindowController != null)
this._xafariDockingWindowController.DockPanelAdded -= _xafariDockingWindowController_DockPanelAdded;
}
}

You can add this controller to any project that has DockPanels and see it in action.
For example, you can check it with the demo Xafari Northwind, which is installed during the installation of Xafari(C:\Users\Public\Documents\Xafari Framework v19.2.6011 Demos\Northwind\CS).

The audit module supports only MS SQL and Oracle.

Feel free to contact us if you have any questions.

Regards,
Mariya
On behalf of Xafari Client Services Team

MollyClient

I ment how to fix dockpanel positions so that end user can't reposition them,close them or minimize them in winforms while storing the model in database.

MariyaVoytovichAgent

Hello!
I apologize for the delayed response.

Xafari DockPanels are based on DevExpress DockPanels.
So that the user can’t reposition them,close them or minimize them in winforms,
you need to do the actions described in the ticket DockPanels fixed positions

Feel free to contact us if you have any questions.

Regards,
Mariya
On behalf of Xafari Client Services Team

MollyClient

Let me restate my question. Look at the northwind demo at the orders view,there are various dock panels in various positions.How do you set these positions at development time. Am storing Model Differences in the database

MariyaVoytovichAgent

Hello!

Sorry for the delay with the answer.
All positions of the dock panels of the Northwind project are stored in the model. (see Model.xafml file in the Xafari.Northwind.Win.App project)
The position is stored in the Layout parameter.
Dock Panel Lauout

Unfortunately, at the moment there is no way to save the layout of the view in a model that belongs to the project itself. (for example, to the Model.xafml file in the Xafari.Northwind.Win.App project)
DockPanel position settings are saved to the user model at run time.
You can customize the panels in runtime, then close the application.
Customization of panels should be preserved in the user model.
You can manually drag this into the application model.

Feel free to contact us if you have any questions.

Regards,
Mariya
On behalf of Xafari Client Services Team

× This ticket is closed.

Write US