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

How to obtain data from a Sparkline field corresponding to a selected row or card using the client side script

$
0
0

 

The following example demonstrates how to obtain client data corresponding to a particular visual element using ASPxDashboardViewer's client-side API.

In this example, the ASPxClientDashboardViewer.ItemClick event is handled to obtain client data and invoke the dxPopup widget with the child dxChart.

In the event handler, the ASPxClientDashboardItemClickEventArgs.GetData method is called to obtain dashboard item's client data. The ASPxClientDashboardItemClickEventArgs.GetAxisPoint method returns the axis point corresponding to the clicked card while the ASPxClientDashboardItemData.GetSlice method returns the slice of client data by this axis point.
To obtain axis points belonging to the "Sparkline" data axis, the ASPxClientDashboardItemDataAxis.GetPoints method is used. Corresponding actual/target values are obtained using the ASPxClientDashboardItemData.GetDeltaValue method.

The dxChart is used to display the detailed chart showing a variation of actual/target values over time.

See Also:
T170990: How to retrieve last level data from Client Dashboard Item and display it using different ASP.NET controls
T182186: How to get visible data from a certain dashboard item on the client side and process it on the server side



How to: Customize a Window Caption and Status Messages

How to use TreeList for file management (drag and drop files and folders)

$
0
0

This example is based on the Explorer module contained within the TreeListMainDemo sample project. It illustrates how to implement the Drag and Drop functionality in TreeList, which will also allow the moving of actual folders and files. To implement such Drag and Drop functionality, handle CalcNodeDragImageIndex to customize an image to be dragged and the DragDrop event to implement custom drag logic, as well as the logic of moving files and folders.

Question Comments

Added By: Christian King 1 at: 10/15/2014 10:07:36 AM    

Do you have a version of this example done in ASP.net instead of WinForms?

Added By: Anthony (DevExpress Support) at: 10/15/2014 11:14:02 AM    

Hi Christian,

Please refer to the How to reorder ASPxTreeList sibling nodes, using buttons or drag-and-drop example that illustrates the same functionality for ASP.NET. If you have any additional questions, please create a ticket and describe your issue in detail.

Added By: Balagurunathan Marimuthu at: 4/27/2017 11:22:18 PM    Its working perfectly. But, I need additional option as need to drag and drop a file into treelist will copy paste that file into the node where i dropped.

Is it possible to do this? Could you please provide me an example for this?

How to use hyperlinks in GridControl cells

$
0
0

This example demonstrates how to show hyperlinks in a grid. To accomplish this task, it is necessary to create a new DataTemplate with HyperlinkEdit and assign it to the GridColumn.CellTemplate property.

Question Comments

Added By: Pritesh P at: 3/11/2014 3:46:07 AM    

hi.
Still i want one more functionality if possible.
I want that "can TextBlock behave same as like Hyperlink in HTML".

Right now it will treat as text.
And i want that can TextBlock support <span> tag & span tag's properties.

Added By: PraveenKumar Kuppuswamy at: 4/28/2017 11:40:22 PM    Hi,

The HyperLink Control is not displaying in Version 16.1.4 Version in devexpress why?.

Thanks
Praveen

How to: Use the Workflow Module

[Deprecated] How to define a custom Color Scheme for Windows 10 XAML controls

$
0
0

Starting with v17.1, we provide a more powerful and flexible way of overriding predefined colors. Refer to the updated example for more information: T510124 - How to define a custom Color Scheme for Windows 10 XAML controls.


This example illustrates how to implement a custom Color Scheme and use it in your application. In the current implementation, the application supports two themes (Generic and Custom), which can be changed by using the corresponding ComboBox. 

The Custom theme is defined as a separate ResourceDictionary with the corresponding value in the x:Key property. This ResourceDictionary is declared within a separate file and then used in the Source property of the GlobalColorSchemeOverrider class.

All colors available for overriding are listed in separate files within the installation folder with our controls: <DevExpress Installation Folder>\Components\System\UAP\ColorThemes

[Deprecated] How to support default Color Schemes in a custom control

$
0
0

Starting with v17.1, we provide a more powerful and flexible way of linking custom colors to colors from predefined Color Schemes. Refer to the updated How to introduce Color Scheme support for a custom control example for more information.

This example illustrates how to support default Color Schemes (Generic and Win8) in a custom control. In this implementation, a CustomRibbonItem control uses colors defined for the default Color Schemes and changes its appearance according to the current Color Scheme. 

All the required colors for different Color Schemes should be defined within a separate ResourceDictionary file. To use these colors in styles or templates declared within a certain ResourceDictionary, include the dictionary with colors into the MergedDictionaries collection of the target ResourceDictionary by using the ColorSchemeDictionary class and its Source property. 

Icon Library Explorer

$
0
0

 In this example, you can see all icons that are available in our Icon Library.

To easily find the required image, you can filter them by image size or used collection or group data by columns. In addition, you can use the Search Panel to find an icon by its text. Then, copy the required icon ID from the "Full Icon ID" column and insert it to the IconID property in your project:

[C#]
settings.Items.Add(item=>{item.Text="Home";item.Image.IconID="navigation_home_16x16";});


See also:
How to use the DevExpress Icon Collection


How to use the DevExpress Icon Collection

$
0
0

The sample illustrates ways of assigning an image from the DevExpress Icon Collection. Images are presented in sprites. To load sprites properly, register ASPxHttpHandlerModule in the web.config.

1. A full list of DevExpress icons can be found by the following link: Icon Collection. You need to copy the Full Icon ID column value for the necessary icon and assign this value to the Image.IconID property: 

[ASPx]
<dx:ASPxButtonID="ASPxButton1"CssClass="button"runat="server"><ImageIconID="navigation_home_32x32"></Image></dx:ASPxButton>

 

2. Icon Collection constants can be used to assign the IconID at runtime:

[C#]
protectedoverridevoidOnInit(EventArgse){base.OnInit(e);ASPxButtonbutton4=newASPxButton();button4.ID="RuntimeButton";ph.Controls.Add(button4);button4.CssClass="button";button4.Image.IconID=DevExpress.Web.ASPxThemes.IconID.NavigationHome32x32;LiteralControllc=newLiteralControl("<span>This ASPxButton is created at runtime in PlaceHolder</span>");ph.Controls.Add(lc);}

 

3. It's possible to use DevExpress icons for non-DevExpress controls. Form the css class name by joining "dxIcon_" and the Full Icon ID column value. To use IconID constants for server controls, add a new css class to the CssClass property in the Init event handler:

[ASPx]
<asp:ButtonID="Button2"runat="server"CssClass="myButton"OnInit="Button2_Init"/>
[C#]
protectedvoidButton2_Init(objectsender,EventArgse){Buttonbtn=senderasButton;btn.CssClass+=" dxIcon_"+IconID.NavigationHome32x32;}


 4. For a standard input element, use an embedded code block to use IconID constants:

[ASPx]
<inputtype="button"class="dxIcon_<%= IconID.NavigationHome32x32%> myButton"/>


See also:
Icon Library Explorer

How To: Use NavigationButtons to Navigate in WPF WindowsUI Applications

$
0
0

This example demonstrates how to use NavigationButtons to navigate through views in WPF WindowsUI applications.

Question Comments

Added By: DavidGG at: 5/2/2017 6:23:33 AM    Hi,

The vb.net example is actually downloading the c# example.Added By: Ilya (DevExpress Support) at: 5/2/2017 9:34:43 AM    

Hi David,
I've downloaded a VB.NET version of this example and it contains the correct project written in VB.NET. Would you please check this again?

How to sort/group data in a GridColumn against data in another GridColumn

$
0
0

Update: Starting with 17.1, it is enough to use the GridColumn.SortFieldName property to get the desired results.

For older versions, select an appropriate solution in the ComboBox below.

How to create a circled progress bar

$
0
0

This example demonstrates how to create a circled progress bar.

The main difference from a linear progress bar is that the progress status is displayed as a clockwise ellipse segment.

In this example we have created a RepositoryItemProgressBar descendant with the following additional properties.


StartAngle (Start progress bar angle). This property defines the initial position for progress flushing

MinWidthHeightProportion (Minimal width/height proportion). This property defines the minimal width to height proportion for drawing the progress ellipse. If it's equals to one, a circle will be drawn.

ShowTextEllipse (Show ellipse around percents). This property defines whether to draw an ellipse around a percent string.

For flushing the gradient progress, two standard properties are used - StartColor and End Color.

TextEllipseColor. This property defines the ellipse color around the percent


Thus, you can change these properties to achieve the required progress bar appearance.


Question Comments

Added By: Mike Murdock at: 5/3/2017 7:10:32 AM    How do you make the circle thick with drawing pen and maybe change the color and make it "dashes"Added By: André (DevExpress Support) at: 5/3/2017 8:33:29 AM    

Hello,

I've created a separate ticket on your behalf (How to change a circled progress bar border). It has been placed in our processing queue and will be answered shortly.

How to use HTML5 Document Viewer within a DevExtreme application

$
0
0

This example illustrates how to integrate the HTML5 Document Viewer into a DevExtreme-based Single Page Application project.
 
This example consists of two projects.
1. Frontend - a DevExtreme project that includes all necessary styles, scripts and HTML-templates required by the Document Viewer.
2. Backend - an ASP.NET MVC 5 application. At the backend, cross-domain requests are enabled (Access-Control-Allow-Origin) and a custom report resolver is implemented (CustomReportResolver).

For a step-by-step tutorial, refer to the following document: Integration of the Web Document Viewer into a DevExtreme application.

To learn about the previous implementation (prior to version 16.1.9), watch the following webinar video online: DevExpress Reports in Client-Side Web Apps.

See also:
How to use the Web Report Designer within a DevExtreme application

How to implement custom zooming for the chart control in a Windows Forms application

$
0
0

NOTE. Starting with v17.1, zooming a chart via the mouse wheel scales the chart to the current mouse position and the custom zooming method shown in this example is no longer necessary. 

This example demonstrates how to implement custom zooming for the chart control. To accomplish this task, you can handle the MouseWheel event. Within this event handler, you can call the XYDiagram.PointToDiagram method to obtain information relative to the coordinates of the mouse pointer affiliation with a series or series point in a diagram. After that you can manually assign both minimum and maximum internal values of an axis range as your needs dictate.

How to use HTML5 Document Viewer within a DevExtreme application

$
0
0

This example illustrates how to integrate the HTML5 Document Viewer into a DevExtreme-based Single Page Application project.
 
This example consists of two projects.
1. Frontend - a DevExtreme project that includes all necessary styles, scripts and HTML-templates required by the Document Viewer.
2. Backend - an ASP.NET MVC 5 application. At the backend, cross-domain requests are enabled (Access-Control-Allow-Origin) and a custom report resolver is implemented (CustomReportResolver).

For a step-by-step tutorial, refer to the following document: Integration of the Web Document Viewer into a DevExtreme application.

To learn about the previous implementation (prior to version 16.1.9), watch the following webinar video online: DevExpress Reports in Client-Side Web Apps.

See also:
How to use the Web Report Designer within a DevExtreme application


ASPxCardView - How to implement the CRUD (create, read, update, delete) functionality similarly to FormView and DetailsView

$
0
0

This example illustrates how to implement CRUD (create, read, update, delete) operations in the manner supported by FormView and DetailsView. In other words, records should be edited one by one. The easiest way to accomplish this task is to use ASPxCardView. This control supports data binding and data editing operations out of the box. It also provides the form-like layout and allows you to generate required editors with ease. 

Click the "Show Implementation Details" button below to see a step-by-step guide on how to implement this scenario. 

How to register and use SVG shapes in DiagramControl

$
0
0

This example demonstrates how to register and use SVG shapes in DiagramControl/DiagramDesignerControl. The ShapeDescription.CreateSvgShape method creates a shape from a stream that contains an SVG image.

Icons used in the sample project: IcoMoon's "Free Shapes" pack.

How to emulate FormView behavior using the ASPxGridView

How to enforce password complexity in XAF

$
0
0

This task can be accomplished by validating user-entered passwords in the ChangePasswordOnLogonParameters and ChangePasswordParameters detail views. Here, we create a code rule to check password complexity using a custom function. This rule should be checked in a custom context, attached to the DialogOK action, because ChangePasswordOnLogonParameters is a non-persistent object, and the Save context is not appropriate for it.
Also, we have to explicitly initialize the validation rule set, otherwise validation won't work prior to user login.

For additional information, refer to the Non Persistent Objects Validation help topic.

Question Comments

Added By: Joël van der Meer at: 6/28/2012 5:42:49 AM    

This works perfect...but I can't figure out how to make it also work when resetting a password. Apartly it's another action or context, but wich?

Added By: Eduardo Jimenez at: 9/24/2015 2:52:42 PM    

We are having the same problem: password complexity is not being verified during password reset. Can you please indicate how to enable this under 'Change password on first logon'

Added By: Michael (DevExpress Support) at: 9/25/2015 8:24:37 AM    

I've tested the current version of this example and found that the user-provided password is checked as expected in both scenarios (when the 'Change password on first logon' option is set and when the 'Reset Password' action is used).
If I missed anything, please provide a screencast demonstrating how to replicate the issue in this demo. If this functionality doesn't work in your project, create a new ticket and attach your project to it, with the instruction on how to replicate the issue.

Added By: Ryan Elliott_ at: 5/5/2017 6:20:58 AM    This also works with 16.2.3, just an FYI.

How to display checkboxes in TreeList nodes

$
0
0

This example demonstrates how to show checkboxes for TreeList nodes and how to control their behavior.


Question Comments

Added By: Hipokrat at: 4/17/2014 12:10:04 AM    

This example is not showing items as checked, even though some "persons" have IsChecked = true.

Added By: Nils Kraus at: 12/9/2014 2:06:06 AM    

am i mistaking or is this sample somewhat incomplete given the fact the IsChecked-State is not being saved within the item's instance?

Added By: Nils Kraus at: 12/9/2014 2:08:22 AM    

the question rather is: how does one access the checked items within the treelist?

Added By: Andrey K (DevExpress Support) at: 12/9/2014 4:58:13 AM    Hello Nils,

I have created a separate ticket on your behalf in order to provide quicker and more efficient responses. We will answer you here: T184840: How to get checked items within TreeList

Thanks,
AndreyAdded By: Jakub Kahoun at: 5/5/2017 6:26:04 AM    Hello, 

I don't understand this example, in init state there are some instances of class "Person", which has property "IsChecked" setted to TRUE. But there is no binding in xaml. So this is build just by the name of property? Or missing I something?

Thanks,
Jakub Kahoun
Viewing all 7205 articles
Browse latest View live


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