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

How to implement the MS Office Word Navigation control by using TreeList

$
0
0


This example demonstrates how to create a custom painter for TreeList to paint its nodes as buttons


How to Display Underlying Records

$
0
0

The ASPxPivotGrid includes the drill-down capability, which enables you to retrieve a list of records that were used to calculate a particular summary.

To obtain drill-down data, use the pivot grid's CreateDrillDownDataSource method. Its parameters completely identify a summary cell.

In this example, an end-user can view records from the control's underlying data source, associated with a summary cell, by clicking on it. The obtained data is displayed by the ASPxGridView within a popup window.

How to bind ASPxScheduler to ObjectDataSource

$
0
0

In this example, the ObjectDataSource control is used to bind the ASPxScheduler control to middle-layer business objects. Further, you can implement your own custom CRUD-operations (Create, Read, Update, Delete – a common abbreviation for data operations) using an arbitrary data provider.

To make the project simple and easy-to-use, data is written into a session.

See Also:
How to bind ASPxScheduler to ObjectDataSource
How to bind ASPxScheduler to MS SQL Server database
How to bind ASPxScheduler to XPO via the Unit of Work
How to bind ASPxScheduler to SyBase ASE 15 database

MVC - How to pass parameters to a Report by using ComboBox control

$
0
0

This example illustrates how to use the MVC ComboBox component as a custom Parameter Panel for a report.

Example Comments

Added By: Rodrigo Coelho at: 5/24/2013 9:58:20 AM    

The option "Run Online" is not working! Please, fix it.

Added By: Programmer at: 6/6/2013 11:01:17 AM    

Hi. Your 'Run Online' demo isn't working. I'm getting "Invalid column name 'Icon_17'" and "Invalid column name 'Icon_25'" errors.

How to Customize Cell Styles via Event

$
0
0

The following example shows how to customize the appearance of specific cells via the ASPxPivotGrid.CustomCellStyle event.

In this example, custom style settings (the orange background and bold font) are applied to a cell if it meets the following conditions:

-- It belongs to the "Quantity" data field.
-- It's not displayed within total rows or columns.
-- Its value is greater than 50.

Client and server validation within ASPxGridView's templates

$
0
0

This example demonstrates how to perform validation of editors placed within ASPxGridView's templates. Here both the integrated validation via ValidationSettings.RegularExpression and a custom validation on Validation events are used.

Another approach used here is the multi-row editing, which means that the grid allows you to instantly edit several row values. Thereby, the grid's edit form is not used in the example at all. (The multi-row editing approach is also described in example E324.)

It's important that validation in this example is performed both on the client and server, since we cannot guarantee that the client sends us valid data. All validation rules are implemented both on the client and server, but the client validation serves only as an input helper. The final word always rests with the server.

The end user inputs some values into text boxes and clicks the Save button. Then, the client validation is performed. In a regular case, if some editors contain invalid values, the end user will be informed about the mistakes he/she made, and a postback won't be sent to the server. However, even if the client validation passes despite that some of the editors contain invalid values, the server will validate all the editors, and only valid editor data will be sent to the database (in this example, a simple List<Record> stored in the Session is used as a data storage).

How to rotate column header text 90-degrees in ASPxGridView

$
0
0

This example demonstrates how to create vertical column headers. To accomplish this task, it is necessary to rotate the column header 90-degrees by using the cross-browser CSS style. This approach is tied to browser features, so the result could be different in different browsers. To learn more about text rotation, see the CSS Cross-browser Text Rotation article.


Example Comments

Added By: at: 3/19/2013 12:21:21 PM    

Hi There, I tried this sample without success. It is the first that fail. No error messages just the header text keeps horizontal.

Added By: Helen (DevExpress Support) at: 3/20/2013 10:40:07 AM    

Hi,
This approach is highly dependent on browser features, but works correctly in most popular browsers: IE7 and higher, Firefox, Opera, Chrome, and Safari. To determine the cause of this issue, I need additional information. Would you please create a ticket and describe the problem in detail?

How to create fully custom Role, User, Event, Resource classes for use with the Security and Scheduler modules

$
0
0

This example demonstrates how to create fully custom classes for use in our Security Module (Complex Security Strategy) and Schedule Module.
Here is the Activity class, which is an analog of our standard Event class. It is used to represent appointments in the Scheduler Control.
The Employee is an analog of the standard User class. The Group class is an analog of our standard Role class. Two last classes are used as base classes to organize Complex Security Strategy for your application.
Take special note that in addition to security purposes, the Employee class supports the IResource interface, and this allows us to use objects of this class as resources in our custom "appointment" class.
I have also implemented two popular filtering tasks here: filtering appointments by the current logged employee and also filtering resources to show only those owned by the current logged employee.

IMPORTANT NOTES
1. When you implement this solution in your project, do not forget to turn on custom security classes by setting the RoleType and UserType properties for the Security Complex component within the Application Designer.
2. The filtering appointments and resources (plus sorting of resources) is provided by the SchedulerActivityListViewControllerBase class and its descendants. Please take special note that these controllers filter resources as follows:
   a. Administrator account (Sam, to log on, leave the Password field empty) sees all the resources and appointments in the root scheduler view.
   b. Non-Administrator account (John, to log on, leave the Password field empty) sees only his own resources and appointments in the root scheduler view.
   c. Both Administrator and Non-Administrator accounts see their own resources and appointments in the nested scheduler view.

3. You can use these controllers for study purposes, since they demonstrate the most common filtering scenarios in the scheduler view. If you do not need all this specific functionality, remove these controllers and create your own ones (perhaps based on the provided example code) that will do only your specific task. For example, the controllers from this example are not suitable in the nested scheduler view because you miss some part of the default Link/Unlink functionality since the scheduler view is always filtered to show only its own resources and appointments.That may not be desired because you may want to have the capability to link appointments from other resources, but they won't be shown due to the above. Plus, these demo controllers are unnecessary for appointments filtering in the nested scheduler view, because by default, in this view only appointments from the current resources are shown.

See Also:
Security System Overview
Scheduler Module Overview
E1097
E563


How to use the CalculatedPersistentAlias attribute

How to Initialize an Object Created via the New Action

$
0
0

This example demonstrates how to access an object that is created via the New Action. When creating a new Task via the New Action, the Task.StartDate property will be set to the current date. See code in the MyController.cs (MyController.vb) file. For details, refer to the How to: Initialize the Object Created via the New Action topic in XAF documentation.

How to get the error message by using the GetCallbackErrorMessage static method

$
0
0

In this example, the error message is displayed within the redirected page after the error occurs on callback.

The redirection page is specified within the devExpress/errors section of the web.config file by using the callbackErrorRedirectUrl key. The error message is obtained by using the ASPxWebControl.GetCallbackErrorMessage static method. To provide the message redirection between the pages, the ASPxHttpHandlerModule should be registered within the web.config file (for more information, see the How to manually register a HttpHandler Module article).

How to implement multi-row editing in the ASP.NET ListView

$
0
0

The ASPxGridView does not natively support multi-row editing. It is recommended to either use the single-row inline editing by setting the AllowEdit property of the ListView model to True in the Model Editor, or edit objects in a DetailView. The multi-row editing functionality is rarely required, but since our customers usually experience difficulties implementing it, I decided to create this example.

There are several examples on how to implement this functionality in the ASPxGridView without XAF. From my point of view, the How to perform ASPxGridView instant updating using different editors in the DataItem template example is the most appropriate for XAF, because:

- this approach can be easily implemented using runtime code

- we already use DataItem templates to show data in grid cells.


All functionality is implemented in a single controller - the MultiRowEditingController. It performs the following operations:

1. Creates an ASPxCallback control and adds it to a page. This control is used to send callbacks from client-side editors used in grid cells.

2. Replaces the default DataItemTemplate with a custom one (EditItemTemplate). The custom template is required to show editors for the user input in grid cells. This template is based on the DataItemTemplate class used in XAF by default. The only difference is that controls from this template are always in the Edit mode.

3. Assigns the client-side script that performs a callback when the value is changed to the editors added to grid cells via the custom DataItemTemplate. This is done in the editor's Init event handler, because at this moment, the NamingContainer that contains the key of the bound object is available.

4. Handles the callback sent from the client side and changes the value of a corresponding object's property.


I recommend that you review the following help topics for additional information:

Access Grid Control Properties
ASPxGridView.Templates Property

See Also:
How to use custom ASPxGridView template in a Web XAF application

Example Comments

Added By: Yuriy Konytskyy at: 6/3/2013 6:44:39 AM    

I doesn't work in v12.2.10

Added By: Anatol (DevExpress Support) at: 7/1/2013 7:19:13 AM    

I have updated the example. Please see implementation details for version 13.1.

Added By: Sandro Welter (Intelligix) at: 7/5/2013 6:02:00 PM    

I'm getting the error below.

The error occurred:
     Type: NullReferenceException
     Message: Object reference not set to an instance of an object.
     Data: 0 entries
     Stack trace:

How to: Adjust the size of pop up dialogs displayed in ASP.NET applications

How to sort a ListView in code

$
0
0

In this example, we demonstrate how to apply sorting by a property of your business object, and disallow end-users from changing this sorting themselves. Consider the following scenario: we have an Issue business class that has the ModifiedOn property, and we need to show the last modified issue always on the top of the grid. This can be done if we implement a ViewController for the Issue ListView, and configure sorting for the required column of this ListView in the application model. This is done in the SortListViewControllerBase class, which is platform-agnostic.
After that, we should implement platform-dependant controllers that will disable the sorting functionality in the grid. Take special note that by using this approach, your end-users will see that the grid is sorted by a column (a small arrow will be shown in the column header). Alternatively, you can use the Sorting property of the ListView application model element.
This approach can be used to sort both nested and root ListViews, and also will work if the server mode is enabled in the ListView.

See Also:
How to sort a nested ListView at the business objects level, in code
How to prevent sorting and grouping by certain columns in a ListView
How to: Access the Application Model in Code

Example Comments

Added By: R. Frese at: 6/17/2013 7:04:04 AM    

Doesn't work at all.
Nothing sorted in the ListView.

Added By: Dennis (DevExpress Support) at: 6/17/2013 8:32:39 AM    

Hello,

This example works as designed in my tests. From the example's description:

In this example, we demonstrate how to apply sorting by a property of your business object, and disallow end-users from changing this sorting themselves.

Let me know if your http://www.devexpress.com/Support/Center/Question/Details/Q502821 ticket if there any questions.

How to: Create Information Panels

$
0
0

This example shows how you can create information panels. The complete description is available in the How to: Create Information Panels help topic.


Example Comments

Added By: Willem de Vries at: 12/18/2012 1:36:33 AM    

I'd like to see how the current skin can be applied to the panel.

Added By: Konstantin B (DevExpress) at: 12/21/2012 6:10:33 AM    

Hi Willem. You can see it in the FeatureCenter demo ("Frame Templates" | "Info Panels" section).


How to: Implement Domain Components

How to: Create a Custom Function Criteria Operator

$
0
0

This example shows how to create a custom Function Criteria Operator you can use anywhere it is required - in List View filters, Validation and Appearance rules, object-level security permissions, etc.

How to: Obtain Underlying Data

$
0
0

The DXPivotGrid includes the drill-down capability, which enables you to retrieve a list of records that were used to calculate a particular summary.
To obtain drill-down data, use the PivotGridControl's CreateDrillDownDataSource method. Its parameters completely identify a summary cell.
In this example, an end-user can view records from the control's underlying data source, associated with a summary cell, by double-clicking on it. The obtained data is displayed by the DXGrid within a popup window.

How to print and export a dashboard

$
0
0

The following example demonstrates a workaround that allows you to print and export a dashboard via the Print Preview.

In this example, the Customer Support dashboard is displayed. You can invoke the Print Preview for the dashboard in one of the two modes, using the Show Preview or Show Paged Preview button. In the first mode, the paper size is adjusted to fit the dashboard. In the second mode, the dashboard gets split across the appropriate number of standard A4 pages.

To accomplish this, we have created a DashboardExporter class that implements the DevExpress.XtraPrinting.IPrintable interface. DashboardExporter instances are mapped to a DashboardViewer when they are created and then passed to the Print Preview thus bringing the dashboard to paper.

Example Comments

Added By: S Broskie at: 2/12/2013 9:40:51 AM    

I appreciate the sample. I did have one question related to the size. If I squeeze the form down, which reduces the dashboard size and then do a print preview, the sides get chopped off. What would be the best way to keep the preview and export at a consistent size without having to worry about a user shrinking the form and therefore shrinking the output? Clone the dashboard somehow and actually do the export on that internally sized clone? If so, could you augment the sample to try and export a consistent size no matter what shape the form and dashboard are in?

Thanks!

Added By: Boris Soto at: 3/12/2013 11:34:23 PM    

I used this code in a new dashboard viewer, how do I tell the button to print the dashboard and what about if I have multiple dashboard

How to customize the appearance of cells

$
0
0

The following example demonstrates how to customize the appearance of the pivot grid cells.

Viewing all 7205 articles
Browse latest View live


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