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

How to: Navigate to Another Page When Clicking SlideViewItem Headers

$
0
0

This example creates a SlideView control with child SlideViewItem objects. Clicking a SlideViewItem's header navigates to another page specified by the SlideViewItem.HeaderNavigationTargetType property.

Automatic page navigation is ensured by using the DXFrame object instead of the standard Frame class.


How to: Populate DXListView with Data from Datasource (Draft)

$
0
0

You can go through the "How to: Populate DXListView with Items from Datasource" tutorial, which is available in the documentation, to get step-by-step instructions of populating a DXListView with data stored in a data source.

To start working with this tutorial, please download the draft project from the current page. It contains a sample data source and classes used to retrieve data from the data source.

The result of this tutorial can be found at E4378.


How to: Populate SlideView with Data from Datasource (Draft)

$
0
0

You can go through the "How to: Create SlideView and Populate It with Data" tutorial, which is available in the documentation, to get step-by-step instructions of populating a SlideView with data stored in a data source.

To start working with this tutorial, please download the draft project from the current page. It contains a sample data source and classes used to retrieve data from the data source.

The result of this tutorial can be found at E4369: How to: Populate SlideView with Data from Datasource (Final Code).

How to: Populate SlideView with Data from Datasource (Final Code)

$
0
0

This example shows how to populate a SlideView control with data from a data source.
A tutorial giving you step-by-step instructions to recreate this example can be found in the documentation.

How to populate ComboBoxEdit with enumeration elements

$
0
0

To bind ComboBoxEdit to an enum, use the EnumItemsSource markup extention in the following manner:

[XAML]
<dxe:ComboBoxEditItemsSource="{dxe:EnumItemsSource EnumType=local:MyEnum}"/>

For version 13.1 and earlier:
All logic is encapsulated in the BaseComboBoxStyleSettings descendant which is defined in the MyComboBoxStyleSettings.cs(vb) file. The representation of items in the popup window depends on the enumeration items kind. E.g., if enumeration items have description attributes they will display the description text instead of item names. If the enumeration definition is decorated with the FlagsAttribute attribute, items will be represented as check editors with the TextBlock element used as description.

How to connect to a remote data service from a Silverlight application

$
0
0

Scenario:

In this example we will create a WCF IDataStore service that will be used by our client (SilverLight Application) as a data layer. Instead of direct connection to the database, our client will connect to a remote service, which is way more secure and thus important in many enterprise scenarios as database connection settings are not exposed to the client. Also all inquiries will be performed asynchronously to not block the UI thread.

Steps to implement:

1. Implement the WCF service as shown in the How to connect to a remote data service instead of using a direct database connection example.

2. Add a new Silverlight Application project.

3. Reference DevExpress.Data and DevExpress.Xpo assemblies.

4. Implement a Customer class as shown in the example's Customer.xx file.

5. Drop GridConrtol to MainPage.

6. Modify the MainPage.xx file as shown in the example's MainPage.cs file.
The MainPage uses Dispatcher to call the BeginInitializeDataSource method asynchronously, which creates a query and uses the EnumerateAsync method to set the GridControldata source.

As a result, you will see the following page:

Important notes:
At the development stage you can face the CommunicationException. This could be due to the attempt to access a service in a cross-domain way without a proper cross-domain policy in place, or a policy that is unsuitable for SOAP services. You will need to publish a cross-domain policy file and ensure that it allows SOAP-related HTTP headers to be sent. Also you can simply add your Silverlight application via the "Silverlight Application" window in the WCFService property window as shown in the following screenshot:

How to automatically generate Ribbon pages, groups and items based on a view model collection in the MVVM pattern

$
0
0

This example demonstrates how to generate pages, groups and items from a collection according to the MVVM pattern. To generate pages in the RibbonPageCategory, bind the PagesSource property to a collection. Use the PageTemplate property to specify a template for generated pages.

RibbonPage and RibbonPageGroup contain similar properties for generating groups and bar items:

- GroupsSource, GroupTemplate

- ItemLinksSource, ItemTemplate

How to create a custom exporter for a specific format

$
0
0

This example illustrates how to create and register a custom DocumentModelExporter for a BBCode format. It supports a number of basic BBCode tags (including hyperlinks and images). The major export functionality is implemented in overridden Export* methods of the BBCodeExporter class.


DXRichEdit for WPF: Implementing MVVM

$
0
0

This example illustrates how to implement a MVVM pattern (see Model View ViewModel) in an application for RTF text editing. Model is represented by the CarInfo class with the Name and Description properties. The CarInfoViewModel class represents a view model. It wraps the model object and exposes its properties to the view which is represented by the EditView class. The view model implements the INotifyPropertyChanged Interface for the properties it exposes so that the view can easily data bind to them. The actual data binding is defined in the EditView.xaml file via a XAML binding of the RichEditControl.Content Property to the Description property of a view model, which in turn, is defined in the UserControl's data context:

[XML]
<UserControlx:Class="RichEditMVVMScenarioWpf.View.EditView"...><UserControl.DataContext><vm:CarInfoViewModel/></UserControl.DataContext><UserControl.Resources><dxre:RtfToContentConverterx:Key="rtfToContentConverter"/></UserControl.Resources> ... <dxre:RichEditControlName="reDescription"Content="{Binding Description, Converter={StaticResource rtfToContentConverter}, Mode=TwoWay}"/></UserControl>

Note that the RtfToContentConverter is used for binding. See the DXRichEdit for WPF: How to use RichEdit converters to bind a RichEditControl to a particular entity and vice versa example to learn more on this concept.

The view model also contains Load and Save commands that are used to persist model property values in the database. This logic is implemented via regular ADO.NET methods.

Prior to running this example, it is required to register a "CarsDB" sample database on your local SQL Server instance. You can download the corresponding SQL scripts from the How to use a RichEditControl in bound mode example.

The picture below illustrates the sample in action.

See also:
WPF Apps With The Model-View-ViewModel Design Pattern
WPF/MVVM Quick Start Tutorial

DXRichEdit for Silverlight: Implementing MVVM

How to create drill-down documents with DXPrinting for WPF

$
0
0

This example demonstrates how you can provide interactivity for documents that are displayed in a Document Preview for WPF.

In particular, it shows how you can implement a drill-down document, in which detail data is hidden until a user clicks a link in the Document Preview, after which the corresponding part of data is shown in the same document.

How to implement the quick search feature for the NavBarControl

$
0
0

This example demonstrates how to implement the quick search feature for NavBarControl. The solution contains the SearchHelpers class that provides the CreateSearchPanel method that creates an additional group in your NavBarControl with TexEdit . So, you can filter your NavBarControl by item names. Also, it is necessary to set the required search criteria. This sample provides three search criteria:

1) Contains;

2) StartsWith;

3) Equals.

Date range filtering in the Filter Row

$
0
0

The ASPxGridView has the Filter Row, but unfortunately it doesn't provide the FilterRow template. However since v2009 vol 2 version, the ASPxDropDownEdit control can easily provide its template, which can be used as a filter editor.
This example demonstrates how to filter the range of dates using the similar approach demonstrated in the example E353: Create the Custom Filter Criteria. This example uses the DropDownEditProperties.

Starting with version 13.1, this can be achieved simpler. You can use the FilterCell Template of the ASPxGridView. See a solution for that version.

See Also:
E2203: CheckComboBox filtering in the Auto Filter Row
E1950: ASPxGridView - Date auto filter
E5038: GridView - How to implement date range filtering using a custom editor in the AutoFilterRow

Question Comments

Added By: Gunnar Steinn Magnússon at: 8/24/2012 9:03:41 AM    

Could you please post a suggested way to do implement this with MVCxGridView?

Added By: esa s at: 7/29/2013 6:46:41 AM    

hi, in this sample by clicking twice on the Apply button (without changing dates), the dateSelector control would not be loaded and it will cause an exception in your gridview, would you please check this ? thanks

How to make the TreeList control have a pop up column filter

$
0
0

Starting with version 11.2, this functionality is supported out of-the-box when the TreeList.OptionsBehavior.EnableFiltering option is active.

This sample shows how a pop up column filter can be added to the TreeList control. Here is a descendant of the TreeList class with filtering capabilities that looks similar to the GridView's pop up column filters. The collection of column filter conditions can be saved and restored with the layout via TreeList's SaveLayout and RestoreLayout methods. Also column filters can be saved and restored separately from the rest of the layout.

Question Comments

Added By: Simon Hewitt at: 11/9/2012 8:18:29 AM    

Just hangs with an invalid cast exception for me.

Added By: Iggy Pop at: 12/27/2012 4:06:42 PM    

also does not work for me.... (exception)

Added By: Freddy Schlosser at: 6/10/2013 1:08:58 AM    

It does not work for me. I convert the project to DevExpress 13. 1 and set the platform target to x86. I Receive an exception
Das Objekt des Typs "DevExpress.XtraEditors.Drawing.GridFilterButtonInfoArgs" kann nicht in Typ "DevExpress.XtraTreeList.TreeListFilterButtonInfoArgs" umgewandelt werden.
in
     static class Program
     {
          /// <summary>
          /// The main entry point for the application.
          /// </summary>
          [STAThread]
          static void Main()
          {
               Application.EnableVisualStyles();
               Application.SetCompatibleTextRenderingDefault(false);
               Application.Run(new XtraForm1()); <==== this line throws the exception
          }
I had the same error with the other Version 12.x from this sample.

Added By: Gyula Kristo at: 9/5/2013 11:20:29 PM    

Works great! Thx

How to obtain only values cells that are visible

$
0
0

This task can be accomplished by using the GridViewInfo class. This class provides collections of the visible rows
(the GridRowInfoCollection) and visible columns (the GridColumnsInfo).


How to customize PDF Viewer Ribbon

$
0
0

The following example shows how to customize PDF Viewer Ribbon.

To accomplish this task, it is necessary to override the default PdfViewerControl's RibbonTemplate and add the required bar items to the newly defined RibbonControl.

How to provide the capability to display a footer at the top of a GridView

$
0
0

The current example illustrates how to customize the default GridView, so that it can display a footer at the top of a view.

XtraTreeList: How to save state of checkboxes into the bound data table

$
0
0

The current example illustrates how to implement storing state of checkboxes which are shown in the TreeList. Checkboxes values are stored in the TreeList's bound data table.

How to provide sorting functionality for the grid that allows drag and drop row reordering

Specify an unbound column in detail view

$
0
0

You should configure your detail view as described in the Master-Detail: DataTable Use help topic. Take note of the 5th point: "Specify and Customize Views To Represent Datatables ".
Create an unbound column for the detail view, and subscribe to the CustomUnboundColumnData event of the detail view. Handle this event as described in the following topic:
ColumnView.CustomUnboundColumnData Event

Viewing all 7205 articles
Browse latest View live


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