Get Started | Xafari Dock Panels
Select Page

Get Started

This section contains comprehensive information on the use of Xafari Dock Panels. Here you can learn how to create and customize Dock Panels. This section includes the following lessons:

See Also: https://galaktikasoft.com/documentation/xafari/dock_panels.html

How to bind Dock Panel to the Business Class, View or the Main Window.

First, you need to add Dock Panels functionality to the application. Business class: Call the Model Editor and navigate to the business class node in BOModel. Add a new ClassDockPanel to the DockPanels node. Set View and GUID properties. Look at the image below for an example. View: Call the Model Editor and navigate to the View node in Views. Add a new ViewDockPanel to the DockPanels node. Set View and GUID properties. See the image below for more info. 3 Main window: Call the Model Editor, navigate to the Xafari|DockPanels node, and add a new MainWindowDockPanel. Set View and GUID properties. The image below demonstrates the process. 4 Save changes and run the application to see the results. To learn more about Dock Panels customization, refer to the following lessons:

How to set relation types.

The View within the Dock Panel and View within the parent window can form the Master-Detail relationship, i.e. the current object of the Dock Panel View may be used as a filter for the parent window and vice versa. To use this feature, you need to set RealationType and RelationCriteria properties of the Dock Panel node in the Application Model. For the RealationType property the following four values are available:

  • Independent: there is no relation between the Dock Panel View and the parent window View.
  • Master: the current object of the Dock Panel View is the filter for the parent window View.
  • Details: the current object of the parent window View is the filter for the Dock Panel View.
  • DetailsCurrentObject: Dock Panel displays Detail View for the current object.

RelationCriteria property specifies the relation filter. Examples: 1. See Contact Dock Panel in demo. The Department object is the filter for the Contact objects. The image below shows Contact Dock Panel settings. 52. See Department objects in demo and DepartmentDetailsCurentObject Dock Panel, which displays Detail View for current Department. You can see Detail View for the current object within Dock control parallel with List View. The image below shows DepartmentDetailsCurentObject Dock Panel settings. Dock_Panels_9 3. Contact List View and Department Dock Panel. Current Department object is a filter for the Contact objects. Department Dock Panel has the following settings:

  • RelationType is Master
  • Relation criteria is Department.Oid = '{0:Oid}'.

4. Contact List View and Filter Dock Panel demonstrates how to use advanced criteria to implement a user-friendly filter within the Dock control. The image below shows Filter Dock Panel settings. Dock_Panels_10 Relation criteria is Iif(IsNullOrEmpty('{0:Department}'), true,Department.Oid =  '{0:Department.Oid}') And Iif(IsNullOrEmpty('{0:LastName}'),true,LastName like '%{0:LastName}%') 5. Position List View and Department Dock Panel demonstrates grouping of records in case many-to-many relationship exists. Department Dock Panel in Position node has following settings:

  • RelationType is Master
  • Relation criteria is [Departments][Oid = '{0:Oid}'].

How to customize Dock Panels.

Use the Model Editor to customize Dock Panels. There are plarform-independent and platform-specific options. Platform-independent options are shared. The node of any Dock Panel, regardless of the target application platform,  provides the following properties:

  • ActionsToolbarVisibility is a flag. True value means that the Dock Panel displays the Toolbar.
  • AllowEdit is a flag specifying whether it is possible to edit the displayed data.
  • Delay property specifies the time in milliseconds. It defines the delay of data synchronization for the case when the RelationType is Detail.
  • Group property allows to add an additional level of grouping when displaying the Action that manages the visibility of the Dock Panel.
  • RelationType, RelationCriteria, View and Guid properties are described in the previous sections.
  • TargetViewType property specifies the type of the General View for which the Dock Panel will be active. This option is only available for the ClassDockPanel (see How to bind Dock Panel to the Business Class, View or the Main Window).
  • TargetWindowType property specifies the type of Windows for which the Dock Panel will be available.
  • Criteria property specifies an additional filter for the List View. This setting is available only if the Dock Panel displays the List View.

dock_panels_customization When used in Windows Forms applications, Dock Panels options are expanded by 2 positions:

  • DockStyle property specifies the initial placement.
  • DockVisibility property specifies the initial visibility.

When used in ASP.NET applications, Dock Panels options are expanded by 11 positions:

  • MinHeight and MinWidth properties specifies the minimal sizes.
  • ShowCloseButton, ShowCollapseButton, ShowMaximizeButton, ShowPinButton, ShowRefreshButton specifies if the Dock Panel window displays the corresponding buttons.
  • ShowFooter and ShowHeader properties specifies if the Dock Panel window displays the footer and the header.
  • AllowResize property allows the end-user to change the window size.
  • Visible property specifies the initial visibility.

How to add Dock Panels functionality to the application.

To add Xafari Dock Panels functionality to your XAF application, execute the following steps:

  • Add XafariDockPanelsModule to the Module Project.
  • To use Dock Panels in Windows Forms applications, add XafariDockPanelsWinModule to the Windows Forms Application Project. If the application is operated in Tabbed MDI mode, perform the steps described in the Dock Panels. WinTabbedMDI topic.
  • To use Dock Panels in ASP.NET applications, add XafariDockPanelsWebModule to the Web Application Project. The XAF default template content requires some modifications described in the Dock Panels. Web topic.
  • Build the solution. Creation and customization of panels is done in the Application Model.

To learn more, refer to the following lessons:

Ask the question

4 + 6 =