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

How to display binary images (data URIs) in the dxGallery widget or a dxList template

$
0
0

To display binary images in the dxGallery widget or a dxList item template, encode your image byte array in base64 and use the Data URI scheme. In this case, all the processing will be done on the client side and your image elements inside the dxList template will look as follows:

[HTML]
<imgdata-bind="attr: { src: 'data:image/png;base64,' + your_image_bytes_in_base_64}"/>

You can use the following tools to convert any image into a base64 string:

DevExpress - How to convert a binary image to a base64 string
Motobit
DataURL


How to Add Custom Totals

$
0
0

This example shows how to display custom totals in the 'Country' column field. Four custom totals calculate the Average, Sum, Min and Max values against the data field.

How to show a PDF file using the PdfViewer control

$
0
0

The following example illustrates how to load an existing PDF file into the PdfViewer control.

How to embed ASPxGridView into a custom appointment form for resources selection

$
0
0

This example demonstrates how to host the ASPxGridView inside the DropDownWindowTemplate of the ASPxDropDownEdit that is used for multi-resource selection (when ResourceSharing option is enabled). This approach can be useful when you wish to display some additional content along with the resource items (e. g. their images). Please review the Default.aspx.cs and CustomAppointmentForm.ascx for an implementation details.

How to use the ASPxWebControl.CallbackError event to handle application-level errors occurred during callback processing

$
0
0

Normally, you use the Application_Error event handler, implemented in a Web Application project's Global.asax file, to handle all application-level errors. Prior to v2010.2, errors occurred on callback events of DevExpress ASP.NET controls were not handled via the Application_Error event handler. Now, you can assign Application_Error as an event handler of the ASPxWebControl.CallbackError static event, to handle exceptions thrown in callbacks. To accomplish this, add the following code to your Global.asax file:


[C#]
voidApplication_Start(objectsender,EventArgse){// Assign Application_Error as a callback error handlerASPxWebControl.CallbackError+=newEventHandler(Application_Error);}

To get exception details and log them, use the following code within the Application_Error event handler:


[C#]
voidApplication_Error(objectsender,EventArgse){// ...// Use HttpContext.Current to get a Web request processing helperHttpServerUtilityserver=HttpContext.Current.Server;Exceptionexception=server.GetLastError();// Log an exceptionAddToLog(exception.Message,exception.StackTrace);}
Example Comments

Added By: okan sarıca at: 7/13/2012 5:21:38 AM    

i handle the exception in global asax but how can i send message to callbackcontrol for example ? if i throw a new exception in global asax e.message in callbackError function is 'some error occured'

How to implement drag-and-drop between Grid and TreeList

DXScheduler Getting Started - Lesson 3 - Create a Custom Edit Appointment Form

$
0
0

This example demonstrates how to bind a scheduler control to data with custom fields and provide end-users with the capability to edit these fields in a custom Edit Appointment form.

How to access the PivotGridControl and make it editable

$
0
0

This example demonstrates how to allow inplace editing in PivotGridControl, which is accessible in XAF applications via the Pivot Chart module. IOW, it shows how to change reported XP objects directly from the Analysis DetailView.

See Also:
Pivot Chart Module
PivotGridControl Class
Make data editable within the PivotGrid

Example Comments

Added By: Apostolis Bekiaris (DevExpress) at: 1/16/2013 8:20:39 AM    

See also http://community.devexpress.com/blogs/eaf/archive/2013/01/16/how-to-rule-the-pivot.aspx under the All Pivot cells editable and double paragraph


How To: Create a Slide View and Populate It with Data

$
0
0

This example demonstrates how to create a SlideView, bind it to data and use templates to visualize its items.

How To: Create a FlipView and Populate It with Data

$
0
0

This example demonstrates how to create a FlipView, bind it to data and use templates to visualize its items.

How to localize a DevExtreme application

$
0
0

This example demonstrates how to localize a DevExtreme application. The main idea is to create a "hash table" that contains all the necessary captions and titles associated with a corresponding language. When an application is loaded, the required titles are applied to elements on your views. The example allows you to change the current language at runtime. We use LocalStore to save/restore the selected language between application re-execution.

How To: Create a PageView and Populate It with Data

$
0
0

This example demonstrates how to create a PageView, bind it to data and use templates to visualize its items and item headers.

How To: Apply Changes Made In Underlying Data Source to PopupContainerEdit

$
0
0

In this example the PopupContainerEdit uses the PopupContainerControl that holds the GridControl with 5 columns. The second column's value in the selected row is a displayed text for the PopupContainerEdit.

Clicking the 'Refresh Edit Value' button adds the 'Add' text to the selected grid cell in the underlying data source. Then the PopupBaseEdit.RefreshEditValue method is called. It instantly updates the editor's value by copying a value from the editor's popup window to BaseEdit.EditValue.

How to determine if a any form editor has been modified by an end-user

$
0
0

This example illustrates how to determine if a any form editor has been modified by an end-user:
- Handle the client-side ValueChanged event of all editors;
- If any event has been raised once, mark the form's state "modified".

[JScript]
var isChanged = false;function OnValueChanged(s, e){ isChanged = true;}

[C#]
@Html.DevExpress().TextBox(settings=>{settings.Name="txt1";settings.Properties.ClientSideEvents.ValueChanged="OnValueChanged";}).GetHtml()

[C#]
@Html.DevExpress().SpinEdit(settings=>{settings.Name="se1";settings.Properties.ClientSideEvents.ValueChanged="OnValueChanged";}).GetHtml()

TreeList - How to edit an in-memory data source

$
0
0

This example illustrates how to bind the MVC TreeList Extension with an in-memory datasource with the enabled editing capabilities.


How to bind dxLookup to WebService

$
0
0

This example illustrates how to bind the dxLookup to a WebService using the DataSource object. Note that when you are using the DataSource with the dxLookup widget, it is also necessary to implement the lookup(lookupOptions) method.

Note: The current example does not implement the search mechanism. When using a web service, it is necessary to define the data searchString pattern to filter data at the web service level. For example:


[JScript]
if(loadOptions.refresh){return $.get('http://sampleservices.devexpress.com/api/Products', {... searchString: loadOptions.searchString || ''});}

See also:
dxLookup - Why the "Lookup callback was not defined" error is thrown when clicking an item if data is loaded from a web service

Example Comments

Added By: Domenik Niemietz at: 7/26/2013 9:30:01 AM    

I used this way with some json data and it works as expected and the data gets listed BUT searching does not work... If i enter so letters nothing happens....

Added By: Marion (DevExpress Support) at: 7/26/2013 9:48:13 AM    

The current example does not implement the search mechanism. When using a web service, it is necessary to define the data searchString pattern to filter data at the web service level. For example:

if (loadOptions.refresh) {
       return $.get('http://sampleservices.devexpress.com/api/Products', {
            ...
            searchString: loadOptions.searchString || ''
        });
}

Spreadsheet Document Server API

$
0
0

This example demonstrates how to use the Spreadsheet Document Server API to programmatically manage spreadsheet documents, without the need for Microsoft Excel to be installed.

In particular, this sample introduces API properties and methods used to perform the following operations:

- Manage worksheets (activate, create, delete, rename, move, copy, show/hide worksheets, adjust worksheet view, etc.)

- Manipulate rows and columns (insert, delete, copy, show/hide, group rows and columns, adjust row height and column width, etc.)

- Manipulate cells and cell ranges (set cell values, add hyperlinks to cells, name, copy and merge cells)

- Create formulas (use various functions and cell references in formulas, name formulas and use names in formulas, create shared and array formulas, etc.)

- Format cells (create, modify and apply styles, set cell font, colors, alignment, borders, number format, etc.)

- Import data from different sources

- Export the workbook to PDF

- Print the workbook

For more information, review the Examples section in the documentation.


ListBoxDragDropManager - How to reorder items

$
0
0

The current ListBoxDragDropManager version does not provide the capability to reorder items. This example demonstrates how to implement this functionality manually.

In this example, we have created a ListBoxDragDropManager class descendant and overridden its OnDragOver and OnDrop methods to add the capability to drop an item before or after another item.

You can use this class like the original ListBoxDragDropManager in the following manner:

[XAML]
<dxe:ListBoxEditx:Name="editor1"DisplayMember="Name"><i:Interaction.Behaviors><local:MyListBoxDragDropManagerx:Name="manager1"/></i:Interaction.Behaviors></dxe:ListBoxEdit>

How to customize the Edit Appointment form to show custom fields

$
0
0

This example illustrates the use of a custom form to enable the end-user to edit custom fields. The custom form is invoked instead of the default one by handling the SchedulerControl.EditAppointmentFormShowing event.

See also:
For a simple application that enables you to handle custom fields, see the E2782: How to create a simple scheduling application that uses custom appointment fields and a custom editing form article.

Example Comments

Added By: Bill Scharf at: 6/12/2013 12:51:13 AM    

Great example! The combobox for resources does not seems to list the resources. I have tried to figure out how to remedy this, but my skills are probably lacking. It does seems to stream in the resources from XML. The combobox does seem to be pointed to a resourceComboboxControl. What else am I missing?

Added By: Brian (DevExpress) at: 6/13/2013 3:23:45 AM    

Use the following line of code:
this.resourcesComboBoxControl1.SchedulerControl = control;
to initialize the combobox for resources in a custom form.

Added By: Bill Scharf at: 6/13/2013 12:56:56 PM    

Thank you Brian, but that is not a workable solution. What that does is link the main scheduler control to the Combobox (correct me if I am wrong). So when I have the Scheduler viewing appointments for all resources, and creating a new appointment for resource #2 then when I return to the scheduler's main control the appointments for the other resources are gone.

What I am looking for (and probably just to ignorant to find despite hours of searching) is probably very simple. I want to be able to edit the resources for an appointment (yes, more than 1 resource per appointment is possible and I have resource sharing turned on). something like:
...on initialization
AppointmentResourceEdit1.selectedResourceIDs = apt.resourceIDs
....and when clicking "ok" something like:
controller.ResourceIDS = AppointemntResourceEdit1.selectedResourceIds

What am I doing wrong or missing?

Added By: Brian (DevExpress) at: 6/14/2013 5:01:33 AM    

You have to make changes via controller, not to modify appointment directly. To edit resources, obtain resource collection via controller.ResourceIds, clear it and add resources from the AppointmentResourceEdit.ResourceIds.
Please open a support ticket and send a sample project to our Support Team, and they will certainly help you.

OBSOLETE - How to suppress a popup "Do you want to save changes ?" dialog when updating a record in the editable ListView

$
0
0

======================
This example is no
w obsolete. Refer to the Core - Redesign ListViewAutoCommitController and WinDetailViewController to customize them properly for more details.
======================

This example demonstrates two modes of work of an editable ListView in Windows Forms applications. The modes can be configured via the WinDetailViewController.AutoCommitListView property.
Setting this property to True in particular helps to disable the above dialog.

Example Comments

Added By: Robert Fuchs at: 5/30/2012 5:51:32 PM    

Is this obsolete in 11.2?

Viewing all 7205 articles
Browse latest View live