Several Mx components can be used while designing user interfaces. Components like MxAdapter, MxDiagrams, MxCharts, etc can all be used to customize an interface. In order to use data defined in previously created adapter the adapter must first be attached to MxPart component. Similar is with MxDiagram component and other Mx components.
All previously created components are listed in the Toolbox under the section with project components. Before a control can be bind to an adapter or any other previously created Mx component, this component must be attached to the part. Mx component can be added to a part by double clicking it in Toolbox or with a drag and drop method to the part’s canvas. Added component is displayed in the bottom section of the screen.
After the component is attached on the part, controls can be bind to it. For detailed instruction on how to bind controls see chapter Mx Controls.
Example (MxSpace)
To see the attached project component in MxSpace application open MxSpace solution project in Visual Studio. In Solution Explorer expand node Parts and double click ArticlesPart.cs. See the attached articlesAdapter1 component at the bottom of the designer.
To attach project component
- Open the desired Mx component (ArticlesPart), to which you wish to attach project components, in Solution Explorer.
- Open Toolbox window.
- In section project components (MxSpace.Components) double click the desired adapter (ArticlesAdapter).
- The component is added to the component (part) and can be seen at the bottom of the designer.
The attached component can now be used in order to present data in a grid, report or any other Mx control. To bind controls with the adapter, its properties Adapter and DataSourceName must be defined.