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

ASPxGridView - How to emulate custom and action buttons with tooltips

$
0
0

This is a temporary workaround for the B134759 request.


Layout API - Simple Example

$
0
0
This example implements a simple Visitor to traverse the document layout tree. Starting from 15.2, it includes a custom painter to custom draw layout elements. Review the Layout API document for more information.

How to: Add Custom Elements to the Available Items Panel

$
0
0

By default, the Available Items Panel contains the following elements:

- The New Group Box and New Tabbed Group items;
- Items that were removed by a user in Customization Mode.



To initially make certain items invisible and show them in this panel, add items to the LayoutControl’s AvailableItems collection.

How to: Use Vertical and Horizontal Layout Modes in NavBarControl

How to sort a report in DocumentPreviewControl

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

$
0
0

Scenario
The FileSystemData module provides the FileSystemStoreObject and FileSystemLinkObject classes that implement the IFileData interface for the use with our File Attachments module.
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 this functionality in action: http://www.screencast.com/t/Xl1GMfxw

Steps to implement
1. Copy and include the FileSystemData project into your solution and make sure it is built successfully.

2. Invoke the Module Designer for the YourSolutionName.Module/Module.xx file by double-clicking it in Solution Explorer. Invoke the Toolbox (Alt+X+T) and then drag & drop the FileSystemDataModule component into the modules list on the left.
3. Define a FileSystemStoreObject or FileSystemLinkObject type properties within your business class as described in the eXpressApp Framework > Task-Based Help > How to: Implement File Data Properties article. Make sure to decorate the container business class with the FileAttachmentAttribute to provide additional commands for working with files. See the E965.Module\BusinessObjects\FileSystemStoreObjectDemo.xx and E965.Module\BusinessObjects\FileSystemLinkObjectDemo.xx  source files for examples. 

4. Make sure you do not override the DevExpress.Persistent.BaseImpl.BaseObject.OidInitializationMode property in your application and related modules, because the OidInitializationMode.AfterConstruction value is necessary for the correct operation of this module (in the example, the required default value is already set in the FileSystemDataModule class of this example module).
5. Modify YourSolutionName.Win/WinApplication.xx file to handle the CustomOpenFileWithDefaultProgram event of the DevExpress.ExpressApp.FileAttachments.Win.FileAttachmentsWindowsFormsModule class as shown in the E965.Win\WinApplication.xx file.

 

IMPORTANT NOTES
1.
The current version of this example does not support the middle-tier scenario. Refer to the Q476039 ticket for more details.

 

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.

Added By: Steve Perks @ NSS at: 9/19/2014 4:11:17 AM    

Hi Dennis, thank you for the code - it works great in my web application (I'm only using the FileSystemStoreObject). I've made a mod to cover the case where the user has previously saved a business object and subsequently reloads it to edit the FileSystemStoreObject property, namely to pick a different file. In this case _tempFileName is not correctly populated and the old file is not deleted when the file is changed and the business object saved.

My solution was to add the following code to FileSystemStoreObject.cs

   protected override void OnLoaded()
   {
       base.OnLoaded();
       _tempFileName = this.RealFileName;
   }

Hope this helps others and perhaps you could update your code if you also feel this is a good solution.

Added By: Dennis (DevExpress Support) at: 9/19/2014 5:21:49 AM    

Thanks for sharing, Steve. Would you please either record a video showing how to replicate this behavior with the original example or create a functional EasyTest script covering this scenario? This will help me better understand the situation and make changes, if necessary. Thanks in advance! 

Added By: Steve Perks @ NSS at: 9/19/2014 5:47:52 AM    

Dennis, how shall I send the video? No attachments in this thread.

Added By: Steve Perks @ NSS at: 9/19/2014 6:09:35 AM    

It's ok about sending the video, I've decided to host it for a short while here: http://host21.co.uk/e965/

Added By: Dennis (DevExpress Support) at: 9/19/2014 6:13:09 AM    Thanks for your video, Steve. I will take this scenario into account  for future updates.Added By: Genesis Supsup 1 at: 12/30/2015 2:07:35 AM    

Does this already work using Application Server? Given the correct credentials, will this concept work with Dropbox (in replacement to File System)?

How to apply default filtering to master filters in ASPxDashboardViewer

$
0
0
The following example shows how to apply default filtering to master filter items using API of ASPxDashboardViewer. In this example, default filtering is applied to the following dashboard items.
- The SingleFilterDefaultValue event is handled to apply filtering to the Grid dashboard item with the Single Master Filter enabled.
- The FilterElementDefaultValues event is handled to select required values in the List Box filter element.
- The RangeFilterDefaultValue event is used to select the specified date range in the Range Filter.

dxDataGrid - How to implement a custom store with CRUD operations (SQLite)

$
0
0

This example can be tested on a mobile device.

The dxDataGrid binding using a CustomStore help topic and the A custom data source does not apply paging, filtering, sorting and grouping article describe how to implement a custom data source that loads data for a dxDataGrid . 

This example demonstrates how to make a custom store that works with a SQLite data source. For this purpose, the SQLite PhoneGap plugin is used. Note how the custom store's insertupdate and remove methods are implemented to use the plugin's API. Each of these methods will be called automatically by the widget.  When a method is called, we need to execute a corresponding SQL query and pass the required parameters. Note that in order to work with the database, it is necessary to initialize it in the "deviceready" event handler:

[JScript]
//index.js $(document).on("deviceready", function(){... window.db = window.sqlitePlugin.openDatabase({ name: "DB"});});

Note how the deferred object resolves the amount of affected rows in each method and the reject function receives the exception message. This allows displaying the query execution exception in the grid's error row.

The example contains a ready-to-use package file for Android, so you can install and test it right away. Any modification or building the package for iOS will require going through steps described in Packaging.

See also:
Deferred Object
How to implement CRUD operations with a DataSource
dxDataGrid - How to implement a custom store with CRUD operations

Question Comments

Added By: Vivek Kanakia at: 7/3/2015 7:21:12 AM    

Hi,

I want to create mobile and web app using devExtreme
I want to give user offline capability.
Does devExtreme support CRUD operations out-of-the-box for offline storage.

Do you have sample code which demonstrates how to make a custom store like SQLite data source. Or any other data source.

I am interested in knowing insert, update and remove methods implemention. Each of these methods needs to be called automatically by the widget.  

Thanks & Regards,
Deepak Chavan, PMP

Added By: Anthony (DevExpress Support) at: 7/3/2015 12:36:38 PM    

Hello,

To process your recent post more efficiently, I created a separate ticket on your behalf: T263266: Inquires regarding the offline storage . This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.

Added By: Rodi Pivetta at: 12/30/2015 2:32:24 AM    

I try this application on android mobile phone and work fine.
But if I try to run this application with mobile device simulator (using built in Sqlite)  I get the error

Error: 'Uncaught TypeError: Illegal invocation', line 25, file 'http://localhost:62976/js/db.js';.

in the row with code:
for (var prop in items(i)) {

How can I solve this? Is possible debuq Sqlite application with mobile device simulator?

Added By: Anthony (DevExpress Support) at: 12/30/2015 3:48:58 AM    

Hello,

To process your recent post more efficiently, I created a separate ticket on your behalf: T329548: The 'Uncaught TypeError: Illegal invocation' error occurs when using the T218257 example in mobile device simulator. This ticket is currently in our processing queue. Our team will address it soon.


How to: Manage Displayed Properties at the View Model/Model Level

$
0
0

The DataLayoutControl supports managing displayed properties at the data source level using attributes. It supports a large number of standard attributes from the System.ComponentModel.DataAnnotations library as well DevExpress attributes. To obtain the complete list of supported attributes, refer to the Data Annotation Attributes section.

In this example, we demonstrated how to configure groups, items, and item editors using DevExpress FluentAPI.

 

See also
How to: Customize the Way Properties Are Displayed by Handling DataLayoutControl Events

How to: Customize the Way Properties Are Displayed by Handling DataLayoutControl Events

GridView - How to implement a hotkey for inserting a predefined value to the specific field editor in the Edit Form

$
0
0
The main idea is to handle the client-side KeyDown, event, check key code (please note that the MouseEvent/KeyboardEvent object has properties like altKey, ctrlKey and  shiftKey). If a user has pressed a required key combination (Shift+T in this example), cancel the JavaScript event and set a required value (the current date in this example) for an editor using the client-side SetValue method.

To handle a column editor's KeyDown event, we use the GridViewEditDataColumn.PropertiesEdit.ClientSideEvents property. Please note that the PropertiesEdit value should be cast to a correct type of the Properties object before you can access the ClientSideEvents collection.

How to: Allow Expanding Several Groups Simultaneously in NavBarControl Using ExplorerBarView

How to improve performance when hiding ASPxDockPanels with large controls

$
0
0

Even when ASPxDockPanel is hidden, its content will be rendered on a page. The page will contain additional markup with invisible content. To improve performance in this scenario, it is necessary to recreate only the required ASPxDockPanel's content controls on callbacks.

This example illustrates how to implement the aforementioned scenario.
Place two buttons that will show or hide ASPxDockPanel for each ASPxDockPanel on the form. Handle ASPxButton's Init event for all Show and Hide buttons. Apply ASPxButton's client-side Click event and pass ASPxDockPanel's ClientInstanceName, ASPxDockPanel's ID, and a boolean parameter to determine which button is clicked.
On the client side, create a method that will get parameters from the Click event and change a visible state of the required panel. Use ASPxHiddenField to save ASPxDockPanel's visible state. Then, send a callback to the required panel. In the page' Init event, restore a visible state of each ASPxDockPanel on the form on every callback. If a panel is visible, add the required controls onto the panel.

How to: Create Closed (Hidden) Panels

$
0
0

The following example shows how to create closed (hidden) panels. To create closed panels, panel objects are added to the DockLayoutManager.ClosedPanels collection.

In the example, the built-in Closed Panels bar is visible (the DockLayoutManager.ClosedPanelsBarVisibility property is set to Auto). It allows closed panels to be restored on the fly.

Question Comments

Added By: Chris Schiefer at: 6/4/2015 8:18:50 AM    

What if you want a panel to be closed initially, but also want to set the initial docking location?  In this example the panel is initially closed, but once it becomes visible it is floating and isn't docked anywhere.

Added By: Alexander Rus (DevExpress Support) at: 6/4/2015 10:06:15 AM    

Hi Chris,
To process your recent post more efficiently, I created a separate ticket on your behalf: T251406: How to create closed panels with predefined location. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.

Thanks,
Alexander

How to: Build a Layout of Controls within LayoutPanels

$
0
0

This example shows how to arrange controls within LayoutPanels forming a custom layout.

In the example two LayoutPanels are created with controls arranged in a specific manner. Each control is wrapped into a LayoutControlItem object. The LayoutControlItem objects are combined together using LayoutGroup objects.


How to: Create Floating Panels in XAML

How to: Enable MDI Mode for a DocumentGroup

How to: Dock a Panel to Another Panel in Code

$
0
0

This example shows how to dock a panel in code using the methods provided by the DockLayoutManager.DockController object.

In the Button1_Click event handler, a panel is docked to another panel forming a split container (two panels are displayed side by side). In the Button2_Click event handler, a panel is docked to another panel forming a tabbed group.

How to: Move a Layout Item in Code

$
0
0

This example shows how to programmatically move a layout item to another position. To move layout items, the DockLayoutManager.LayoutController.Move method is used.
In the example, an item is moved on the left of another item.

How to: Build Dock UI According to MVVM Pattern Using IMVVMDockingProperties Interface

Viewing all 7205 articles
Browse latest View live


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