Quantcast
Channel: DevExpress Support Center (Examples)
Viewing all 7205 articles
Browse latest View live

How to display and edit XPO in the ASPxGridView

$
0
0

This is a simple example of how to bind the grid to an XpoDataSource (eXpress Persistent Objects) for data displaying and editing. It's implemented according to the How to use XPO in an ASP.NET (Web) application article.

Question Comments

Added By: Hendy Harianto at: 8/21/2013 12:15:27 AM    

Dear Support,
           CustomerOrders.cs is like tables of a database? thx

Added By: Ullas Krishnan 1 at: 6/2/2014 9:20:10 AM    

Dear Support ,

That means I have three different Tables then should I need to create three different XpoHelper class for the three webpages to display each table contents ?

Thanks,
Ullas


How to hide individual navigation items and groups for certain users

$
0
0

Scenario:


Our Security System allows hiding navigation items for certain users by setting the Type Permission's Navigate access. Since with this approach, the Navigate access can be granted only for a certain type, the following scenarios are not supported:

1. It is necessary to hide a DashboardView.
2. There are several navigation items for a certain type, and it is required to hide a part of them.
3. It is necessary to hide a navigation item that is not associated with a certain View (e.g., a navigation group).


This article demonstrates how to extend the security role class with the HiddenNavigationItems property allowing hiding navigation items by their ID.

Steps to implement:

1. Implement a custom permission type - NavigationItemPermission - that can be used to check access permissions for a certain navigation item by its ID.
2. Implement a custom permission request - NavigationItemPermissionRequest - that will be sent to check whether the current user has access to a certain navigation item.
3. Implement a custom permission request processor - NavigationItemPermissionRequestProcessor - that determines whether the current user has permissions for the received permission request.
4. Register the permission request processor in the application by handling the SecurityStrategy.CustomizeRequestProcessors event in the Program.cs and Global.asax.cs files.
5. Implement a custom role with the HiddenNavigationItems property. Override the role's GetPermissionsCore method to create NavigationPermission instances based on the value of the HiddenNavigationItems property.
6. Implement a ShowNavigationItemController's descendant - CustomShowNavigationItemController - and override its SynchItemWithSecurity method to deactivate navigation items prohibited by the CustomSecurityRole.HiddenNavigationItems property.

See also:
How to: Implement Custom Security Objects (Users, Roles, Operation Permissions)

How to display bubble chart items on a map

$
0
0
The following example shows how to generate bubble charts from a datasource.

Spreadsheet Mail Merge - Getting Started

$
0
0

This example demonstrates how to use the Spreadsheet Mail Merge functionality to automatically generate a document based on data retrieved from a specified data source (the Categories table of the Northwind database). The nwind.mdb database file is included in the project. This file ships with the XtraSpreadsheet Suite installation, and found in the C:\Users\Public\Documents\DevExpress Demos 14.1\Components\Data directory by default.

The application includes the following controls.

1. SpreadsheetControl

A ready-to-use mail merge template (the MailMergeTemplate.xlsx file) is automatically loaded into the SpreadsheetControl when invoking the application. This template is bound to the Categories table of the Northwind database via the IWorkbook.MailMergeDataSource and IWorkbook.MailMergeDataMember properties in code.

2. Field List

The Field List panel shows the structure of the mail merge data source at runtime. You can add mail merge fields to template cells by drag-and-drop or by double-clicking the corresponding items in this panel.

3. RibbonControl with the Mail Merge tab
The Mail Merge page contains various command buttons that you can use to modify the mail merge template. For example, you can do the following.
- Enable the Mail Merge Design View. This is a specific mode to display worksheets intended for preparing mail merge templates. It is recommended that you activate this view before creating or modifying a template.
- Select one of the available modes to specify whether data records should be merged into separate workbooks, separate worksheets in a single workbook, or a single worksheet. By default, the Single Sheet mode is used.
- Set the vertical or horizontal orientation for the resulting worksheet.
- Specify the Detail, Header and Footer ranges in the template.
- Sortgroup and filter the data to appear in the resulting document.
- Preview the merged document.
In this example, the Result button is added to the Mail Merge page. It calls the IWorkbook.GenerateMailMergeDocuments method, which returns the resulting workbook and saves it to a file. If the mail merge mode is set to Multiple Documents, each workbook returned by the GenerateMailMergeDocuments method is saved to a separate file.

Spreadsheet Mail Merge - Group Data

$
0
0
When performing a mail merge with the SpreadsheetControl, you can sort data to be merged and split it into groups based on identical values in the specified data field.
This example contains the mail merge template to generate invoices using data from the Invoices view of the Northwind database. The nwind.mdb database file is included in the project. This file ships with the XtraSpreadsheet Suite installation, and found in the C:\Users\Public\Documents\DevExpress Demos 14.1\Components\Data directory by default. The template is bound to the data source via the IWorkbook.MailMergeDataSource and IWorkbook.MailMergeDataMember properties in code.

Run the application and review the prepared template (the MailMergeTemplate_GroupData.xlsx file) that is automatically loaded into the SpreadsheetControl.
On the Mail Merge tab, enable the Mail Merge Design View to highlight the template structure. The template consists of the following ranges.
- Header
The Header range contains the current date to be displayed above each invoice.
- Detail
The Detail range contains fields for merging order data (general order information, products ordered and order totals). In this range, the OrderID data field is set as a criterion for sorting data. To make sure of this, check that the OrderID field is displayed in the Sort Fields dialog (to invoke this dialog, select any cell within the Detail range and click the Sort Fields button on the Mail Merge tab), and the SORTFIELD0 defined name for the OrderID field is added to the worksheet's collection of defined names (you can see this defined name in the Name Manager dialog when you click the corresponding button on the Formulas tab).
- GroupHeader
All general information for a group of records is located within the GroupHeader0 range. In this example, each group is an order. Thus, the group header contains information about the order, customer, salesperson, dates, delivery, etc. The existing OrderID(Ascending) sort field is used as a criterion for creating groups in the merged document (this sort field was selected when the GroupHeader range was created). In the Name Manager dialog, you can see the GROUPHEADER0 defined name that corresponds to this group header range.
- GroupFooter
The GroupFooter0 range displays totals at the end of a group of records (in other words, at the end of an order). It is also created based on the OrderID(Ascending) sort field and saved in the template document as a defined name (GROUPFOOTER0).
In this template, the mail merge mode is set to Multiple Sheets. Thus, each order will be inserted in a separate worksheet. To review the result, click the Mail Merge Preview button on the Mail Merge tab.

How to: Store file attachments in the file system instead of the database

$
0
0

The FileSystemData module provides the FileSystemStoreObject and FileSystemLinkObject classes that implement the IFileData interface and enable you to store uploaded files in a file system instead of the database.
   FileSystemStoreObject - this class enables you to store uploaded files in a centralized file system location instead of the database. You can configure the file system store location via the static FileSystemDataModule.FileSystemStoreLocation property.
   FileSystemLinkObject - this class enables you to add soft links to real files instead of saving their contents to the database. Apparently, it is intended for use in Windows Forms applications only.

Refer to the following video to see it in action: http://www.screencast.com/t/Xl1GMfxw
Feel free to share your feedback on the module at http://community.devexpress.com/forums/t/71862.aspx


IMPORTANT NOTES
1.
The current version of this example does not support the middle-tier scenario. Refer to the Q476039 ticket for more details.
2. It is required to set the BaseObject.OidInitializationMode property to OidInitializationMode.AfterConstruction for the correct operation of this module.

See Also:
File Attachments Module Overview
Working with links to files instead of storing their contents in the database
SQL Server FILESTREAM feature Overview

Question Comments

Added By: Roger Gardner at: 8/2/2012 4:36:37 AM    

-How to change FileStoreObject to work With Application server?
-How many files you can store in one folder and the system is not to slow?

Can this sample be upgraded with Application server and multiple folders in File Data Store folder?

Added By: Sander Mclean at: 8/22/2012 12:31:10 AM    

Thank you for your example, but could you upgrade this to VB.NET?

Added By: Martin Kraeuchi at: 10/12/2012 2:00:24 AM    

I tried to run this example but it crashes.
It occurs a fatal error when I try to append a file after creating a new "Standard File Data Demo" Item. The error occurs at the moment the file select box opens. I didn't found a way to debug it.
Do you have a glue what it could be?

My configuration:
Win7 64BIT, VS2010, v2012 vol 1.7, SQL Server Express 2008 R2

Thanks, Martin

Added By: Dennis (DevExpress Support) at: 11/29/2012 9:56:43 AM    

@Roger: I have not yet tested this module with the application server. It is a good idea, though. Thank you for your input, I have added it to my TODO list.

@Sander: It is quite complex a module to rewrite it in VB.NET, as well as maintain two versions later. Even though it is not in my immediate plans, you can either include the C# module project into your VB.NET solution (Visual Studio allows this) or rather use free or paid conversion tools.

@Martin: Thank you for your comment. Hm, it performs perfectly well for me. I also ran functional tests that passed locally. You are probably not using the latest version in this example. It would be great if you could create a separate ticket in the Support Center and attach the eXpressAppFramework.log file with the error details. Thank you in advance!

PS.
Sorry for the late reply, guys. In the future, it is better to submit a ticket directly via the http://www.devexpress.com/Support/Center/Question/Create link, if you experienced any difficulties with our tools.

Added By: ABRAMO ABRAMO at: 11/21/2013 11:44:40 AM    

Hi,
I'm working with Images in XAF application storing user image file to file system. So I'm using FileSystemStoreObject and It work fine for me. However, I've some problem!

one - I'd like split and save user images in FileData\<mykey1> folder where mykey1 depends by Business Objects instance1,
user images in FileData\<mykey2> folder where mykey2 depends by Business Objects instance2 and so on.
two - I'd like show stored images like Asp.net Images Slides Control or a link item in grid view to open images.

Do you have any suggestion or example?

Best regards,
Gaetano

Added By: Ricardo Granja at: 1/27/2014 4:36:39 AM    

Do vou have an exemple of this as a domain componente?

Regards,
Ricardo

Added By: xaero xy at: 6/2/2014 9:47:03 PM    

Did the "StandardFileDataDemo" store file attachments in database?

Added By: Dennis (DevExpress Support) at: 6/3/2014 2:24:48 AM    

@xaero: The StandardFileDataDemo class uses the FileData class that stores files in the database and which is a part of the standard delivery.

In turn, the FileSystemStoreObjectDemo class stores files in the file system with the help of custom IFileData implementations described in this example.

How to use manual date-time scale options of an Axis

$
0
0

This example demonstrates how to use manual date-time scale options of an X-axis.

The data aggregation is enabled automatically for the date-time scale on the X-axis in manual scale options.

When the Axis.DateTimeScaleOptions property is set to ManualDateTimeScaleOptions  you can manually define ManualDateTimeScaleOptions.GridAlignment, ManualDateTimeScaleOptions.MeasureUnit, and ManualDateTimeScaleOptions.AggregateFunction  properties.

To use the automatic date-time scale options, set the AxisX.DateTimeScaleOptions  property to AutomaticDateTimeScaleOptions and choose the appropriate AutomaticDateTimeScaleOptions.AggregateFunction.

If you wish the axis scale to not be divided into intervals, and therefore aggregation cannot be applied to chart data, set the ManualDateTimeScaleOptions.AggregateFunction  property to None.

ASPxDockPanel: How to Disable Dragging for Certain Areas of the Header

$
0
0

By default it is possible to move an ASPxDockPanel within the page by dragging its header. This example demonstrates how to disable dragging for certain areas of the header.

In this example an ASPxMenu is placed inside the HeaderTemplate of an ASPxDockPanel. Users cannot drag and move the panel if the mouse pointer is on the menu.


Question Comments

Added By: Zoltan Szakaly at: 11/6/2013 4:40:33 AM    

This example good for disable dragging with mouse, but can you tell me, how to do this with "swipe"?

Added By: Alessandro (DevExpress Support) at: 6/3/2014 6:18:03 AM    Hi,

I have created a separate ticket on your behalf at: ASPxDocking - E20044 (How to Disable Dragging for Certain Areas of the Header). Please refer to this ticket for further correspondence on this item.

(Obsolete) How to adjust point options of the Pie series view type at runtime

$
0
0

The following example demonstrates how to specify the appearance of series labels in the Pie chart using its point options.

How to create a PropertyEditor based on the XtraRichEdit control

$
0
0

Take special note that this editor is intended to be used for a simple and most common scenario when only one text property in a Detail View is edited with the help of the XtraRichEdit control. Other scenarios are not supported in this example and are required to be implemented manually. For example, if there are more than one property, edited with this editor in a Detail View, then there may be problems with merging in ribbons. See the B142856 issue for more detailed information.


See Also:
Implement Custom Property Editors
How to: Implement a Property Editor for Windows Forms Applications
XtraRichEdit Home
PropertyEditors - Support the XtraRichEdit control.

Question Comments

Added By: Willem de Vries at: 10/24/2012 7:25:46 AM    

After copying the necessary files to my project, i ran into an error in MergeRibbonDetailViewController. I changed the code slightly (in the test):

        private void Frame_TemplateChanged(object sender, EventArgs e) {
            UnMergeRibbon();
            mainRibbonControl = null;
            IClassicToRibbonTransformerHolder form = Frame.Template as IClassicToRibbonTransformerHolder;
            if (form != null && form.RibbonTransformer != null) {
                form.RibbonTransformer.Transformed += RibbonTransformer_Transformed;
            }
        }

Added By: xaero xy at: 6/3/2014 7:49:52 AM    

Thanks for your great works!
I've downloaded the example, and successfuly runed it. But I can't create a simlar project from ZERO.
Would you write out some brief steps to create this project?
Many Thanks!

ASPxNavBar - How to implement a table of contents with scrollable area

$
0
0

This example demonstrates how to implement a table of contents with the scrollable area using the ASPxNavBar control. An xml file is used as a data source here, however it is possible to do the same with any other data source.
The main idea is to add items both in ASPxNavBar and the scrollable area when you process an entry from the data source.

Once items are added, implement the function that will:
1) Determine an element that should be selected as an active item in the navbar:

[JScript]
var firstFullyVisibleIndex = 0; $(".section").each(function(){var scrollOffset = $(document).scrollTop();var elementOffset = $(this).offset().top;if(scrollOffset < elementOffset){ firstFullyVisibleIndex = $(this).index();returnfalse;}});
2) Select this item in the navbar:
[JScript]
if(selectedSectionIndex != firstFullyVisibleIndex){ selectedSectionIndex = firstFullyVisibleIndex;var group = navbar.GetActiveGroup();var newlySelectedItem = group.GetItem(selectedSectionIndex); navbar.SetSelectedItem(newlySelectedItem);}
Call this function in two event handlers: when the page loads and when the page is scrolled:
[JScript]
$(window).scroll(function(){ SyncNavbar();}); $().ready(function(){ navbar.SetActiveGroup(navbar.GetGroupByName(navbar.cpActiveGroup)); SyncNavbar();});

How to: Build an Office-inspired Application

$
0
0

This example demonstrates how to build an Office-inspired application with DevExpress Scaffolding Wizards.
Refer to a corresponding tutorial in DevExpress Documentation to learn step-by-step how to build this application: Building Office-Inspired Applications

Drag&drop items from one standalone GalleryControl to another one (extended)

How to implement a context menu allowing to activate a certain DockPanel in a tabbed group

$
0
0

Starting from version 11.2, we have introduced a special DockManager.PopupMenuShowing event. Handle this event to show a menu.

For earlier versions:

In this example, the XtraBar PopupMenu is populated with items based on panels from a tabbed group. This menu is shown when the tab header is clicked. When the menu item is selected, a corresponding child DockPanel is activated.

How to animate switching between two grids by using TransitionManager component

$
0
0
This example demonstrates how to use the TransitionManager component to animate switching between two controls on a form.

How to save several layouts into one file

$
0
0

This example demonstrates how to save several xml files to one. For example you may need to save layout information from the BarManager and TabbedView (DocumentManager) components to a singe file. 

How to merge pages in PDF

How to rotate PDF pages

OBSOLETE - How to show a specific detail view for a selected record in the TreeList when the list view is in the ListViewAndDetailView mode

$
0
0

=======================================
This example is now obsolete. Instead, leave the MasterDetailView property empty for the Views | ListView node in the Model Editor.
=======================================

This example demonstrates how to show a view of the required type for a currently selected node in the tree list editor. By default, it shows the only the detail view of the base class.
This example also illustrates how to customize the New action, to allow you to create new objects of only the selected node object type.

Question Comments

Added By: Willem de Vries at: 10/17/2012 5:37:48 PM    

The default behavior has been changed, when i recall correctly. Leaving MasterDetailView empty results in the application selection the appropriate DetailView for the selected object.

How to delete pages from PDF

Viewing all 7205 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>