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

dxChart - How to display data from a remote data service (Knockout)


How to save the currently opened View as a new View Variant at runtime

$
0
0

This example provides a platform-agnostic module that allows your end-users to add View Variants dynamically. Refer to the Best practices of creating reusable XAF modules by example of a View Variants module extension blog post for more information.

IMPORTANT NOTES
1. Although this example contains only platform-agnostic code, it cannot be used in the same scenarios on the Web, because there are no layout customization available for XAF Web applications at this time.

So, you may want to create a Web version of this module with a descendant of the UserViewVariantsController class, and the overridden OnActicated method where the UserViewVariants Action will be disabled if View is DetailView.

2. Due to the application model generation specifics on the Web, model customizations performed by UserViewVariantsController will not be stored between user sessions by default. However, it should work the same way as in Windows Forms applications if you store your end-user model differences in the database or any other store: How to store users' model differences separately for each user in the database

See also:
ViewVariants - provide the capability to save the current view as a new view variant and share it with other users at runtime

Example Comments

Added By: Robert Fuchs at: 9/2/2013 4:36:24 PM    

Modified today but still not for 13.1 !?
Why?

Added By: Dennis (DevExpress Support) at: 9/3/2013 3:16:43 AM    

Robert, this example was already available for version 13.1 before today. Today was just a maintenance update without much changes.

Added By: Robert Fuchs at: 9/3/2013 1:12:12 PM    

Thanks Dennis.
Interestingly the version combo didn't show 13.1 yesterday.
I downloaded it anyway and it worked in 13.1 after changing .Net FW type to 4.

Added By: Richard Jones_1 at: 12/11/2013 4:04:47 PM    

Hello, This is a great solution, but after upgrading to 13.2 it does not compile, Do you have a version for 13.2?
Thanks
Richard

Added By: Nektarios Patelis at: 12/13/2013 3:35:47 AM    

waiting upgrade for 13.2

Added By: Willem de Vries at: 1/8/2014 11:49:14 AM    

Just leaving a comment to be included in any update messages. Waiting for a remedy for this breaking change to be able to upgrade to 13.2 with many of my applications.

Added By: Tony Tadros at: 1/14/2014 12:52:19 PM    

i have a suggestion to support such functionality of of the box

ASPxGridView - How to allow end-users to resize the grid

$
0
0

The scenario is the following:
- Set the ASPxGridView.SettingsPager.Mode property to 'ShowAllRecords';

- Set the ASPxGridView.Settings.ShowStatusBar to 'Visible' and the ASPxGridView.Settings.VerticalScrollBarMode property to 'Auto';

- Change the ASPxGridView's height and width in the mouse move event handler.


The example supports both postponed (when the control's frame is rendered and resized on mouse move, and the control is actually resized after the mouse button is released) and real time resizing (when the control is resized on mouse move). Set the 'postpone' JavaScript variable to 'false', to allow real time resizing.

ASPxDockZone - How to allow end-users to resize a control

$
0
0

It's possible to allow end-users to resize the ASPxDockZone by changing the control's height and width in the mouse move event handler with the ASPxClientDockZone.SetWidth and ASPxClientDockZone.SetHeight methods.


The example supports both postponed (when the control's frame is rendered and resized on mouse move, and the control is actually resized after the mouse button is released) and real time resizing (when the control is resized on mouse move). Set the 'postpone' JavaScript variable to 'false' to allow real time resizing.

How to customize a data store schema for dashboard data sources

$
0
0

This example demonstrates how to customize a data store schema for a dashboard data source that uses a connection to the Northwind database.


In this example, the IDBSchemaProvider interface is implemented by a class that defines a custom data store schema. The GetSchema method returns tables and columns (with specified aliases) which will be included to a data store schema.


To see the result, create a new data source using the existing connection ("Connection 1") or edit the existing data source.

How to connect the map control to a Bing Geocode web service

$
0
0

This example demonstrates how to provide the capability for end-users to click on a map and get detailed information about this place in the pushpin's tooltip, thanks to the Bing Geocode web service.

Note that if you run this sample as is, you will get a warning message saying that the specified Bing Maps key is invalid. To learn more about Bing Map keys, please refer to the How to: Get a Bing Maps Key tutorial.

How to use a custom ASPxGridView localizer

How to maintain the visibility of components in the End-User Designer

$
0
0

The following example demonstrates how to maintain the visibility of components (such as DataSet and DataAdapter) in the End-User Report Designer for Windows Forms.

In the End-User Report Designer, you can hide a report's associated components together, or list them in the Report Explorer or the Component Tray displayed at the bottom of the Design Panel.


How to create a master-detail report bound to an ORM (Entity Framework) model in MVC applications

$
0
0

This example demonstrates how to create a master-detail report bound to Object Relational Model in ASP.NET MVC applications.

This example uses the Entity Framework ORM model to provide a report with data, but you can use any object model instead.

Bind your XtraReport to your model master class by using the approach suggested in the Providing Data to a Web Report => Design-Time Data Binding Using BindingSource help topic. After your report is bound to the master class you can easily insert a detail report band by using the context menu in the report designer, as shown below:

See also:
How to bind a report displayed in the DocumentViewer extension to the model's data

How to connect to a Report Server from a Windows Forms application using Windows Authentication

$
0
0

The sample demonstrates how to use the Report Server WCF API in a Windows Forms application.

How to get information about a geopoint using the Bing Geocode data provider

$
0
0

This example demonstrates how to obtain information about a geographical point from the Bing Geocode data provider using the BingGeocodeDataProvider.RequestLocationInformation method.

There are two ways to do this:

- specify a geographical point (GeoPoint.Longitude and GeoPoint.Latitude) in the TextBox elements. Then, click the "Request Location Information" button;

- find the coordinates of a desired geographical point yourself on the map and click the map point.

It handles the requestLocation_Click event and all parameters are passed to the RequestLocationInformation method.

Results contain a location name (LocationInformation.DisplayName), entity type (LocationInformation.EntityType), address (LocationInformation.Address) and exact coordinates (LocationInformation.Location) that are shown in the RichTextBox element.


Note that if you run this sample as is, you will get a warning message informing you that the specified Bing Maps key is invalid. To learn more about Bing Map keys, please refer to the How to: Get a Bing Maps Key tutorial.


How to change the XtraReport layout dynamically via a custom Report Parameters Object

$
0
0

The Report Parameters Object feature is introduced to show the custom filter dialog before previewing XafReport. But, since it can be accessed via the report's scripts (see Access Report Filter Parameters in Scripts), it is possible to customize other things, depending on the user's choice, with the help of this feature. This example demonstrates how to manage the grouping depth in XtraReport. The value, passed by the end-user via the dialog shown before the Report Preview, is used to change the visibility of group headers, used for grouping, as shown in the following code:

[C#]
usingDevExpress.ExpressApp.Reports;usingWinSample.Module;privatevoidOnBeforePrint(objectsender,System.Drawing.Printing.PrintEventArgse){MyReportParametersObjectreportParametersObject=((XafReport)xafReport1).ReportParametersObjectasMyReportParametersObject;if(reportParametersObject!=null){switch(reportParametersObject.GroupDepth){case 0:GroupHeader1.Visible=false;gotocase 1;case 1:GroupHeader2.Visible=false;gotocase 2;case 2:GroupHeader3.Visible=false;gotocase 3;case 3:GroupHeader4.Visible=false;gotocase 4;case 4:GroupHeader5.Visible=false;break;}}}
See Also:
Scripting Overview
How to use custom ReportParametersObject to filter detail reports ( DetailReportBand )

Validation - How to highlight invalid properties when the View is shown

$
0
0

This example demonstrates, how to check rules when the View is activated, or the View's object is changed. For that purpose, the ImmediateValidationController is implemented. To avoid checking these rules when the business object is saved or deleted, their context is set to Custom.

How to implement a custom attribute to customize the Application Model

$
0
0

This example demonstrates how to use a custom attribute to remove properties from the DetailView.Items and ListView.Columns node. In this case, properties will be removed from the Column Chooser and Layout Customization window, and the user will be able to add them only by using the Add button, placed to these windows in Windows Forms applications.
To implement this functionality, the IModelMember interface is extended with the IRemovedFromViewInfo interface that contains a single property - IsRemovedFromViewInfo. The value of this property is calculated based on the value of the custom attribute (RemoveFromViewInfoAttribute) applied to the persistent class. This is done via the domain logic (RemovedFromViewInfoLogic). Then the IRemovedFromViewInfo.IsRemovedFromViewInfo property is used by the model nodes generator updater (ViewsNodesGeneratorUpdater) to remove certain view items and columns from detail and list views. Thus, the example demonstrates three techniques: extending the Application Model with additional properties, defining default model values via the domain logic and changing the default model via the model nodes generator updater. You can find more information about these techniques in the How to customize the Application Model from the code of the business class article.

See also:
Extend and Customize the Application Model in Code

How to create a DetailView with a custom set of properties

$
0
0

Suppose that it is necessary to provide a capability to work with documents. These documents can have various sets of fields, in various orders. To implement this scenario using standard XAF tools, it is necessary to create a lot of business classes, one for each kind of document. This solution doesn't allow the creation of a new document kind.


This example solves the described above task in the following way:


There is a Document class, which contains fields, common for all documents. It has an associated collection of document items, represented by the DocumentItemBase class and its descendants. To place document items into the Document DetailView, a custom property editor named DocumentItemsPropertyEditor is implemented. It is used for the Document.Items collection and draws a table with editors associated with document items. As a result, it is possible to customize editors shown in the DetailView at runtime.


Note that the example uses the InMemoryDataStoreProvider. To use another database, you need to modify the Session_Start event handler from the Global.asax.cs file.

See Also:
Implement Custom Property Editors

Example Comments

Added By: vguruv at: 7/5/2012 9:56:25 AM    

Does not work in edit mode on v12.1.4


How to represent a collection property using a checked list box

$
0
0

This example contains custom property editors for both Windows Forms and ASP.NET applications. The WinCheckedListBoxPropertyEditor uses the CheckedListBoxControl, and the WebCheckedListBoxPropertyEditor uses a Table with a set of ASPxCheckBox and Literal controls.

See Also:
PropertyEditors.List - Provide an editor allowing to show/edit a details collection with the help of the CheckedListBoxControl control
CheckedListBoxControl Class
Implement Custom Property Editors
How to create a DetailView with a custom set of properties

How to print from the RichEditDocumentServer

$
0
0

This example demonstrates how to use a PrintableComponentLink to print from the RichEditDocumentServer. An instance of the RichEditDocumentServer loads a document, inserts a datetime stamp in its header and prints it.
Various print options, such as page size, orientation and margins are set in code at run time.
The application searches a list of installed printers for a printer containing a certain text ("Canon") in its name and prints to it. If a printer is not found, the default printer is used.


How to show cells' values over an image and be able to export the cells' content to Excel file

$
0
0

This example demonstrates how to show images in GridView's cell and display cell's values over the images. Actually, this task can be easily accomplished using the Custom Draw capabilites. However, in this case, these values cannot be exported. If this functionality is required, you should create necessary images and populate unbound columns via the CustomUnboundColumnData event.

How to implement a radio column

$
0
0

This example demonstrates how to add an unbound grid column with a radio button (represented by a CheckEdit repository item) to provide a user with the ability to select one of the grid rows.

How to compare two text files line-by-line using the GridControl

$
0
0

This example demonstrates how to load a text file in the GridControl, so that each cell represents one text line. Different lines are highlighted.

Viewing all 7205 articles
Browse latest View live


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