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

dxChart - How to show a percent value in a stacked bar tooltip

$
0
0

This example illustrates how to show a percent value in a tooltip of a stacked bar dxChart. To accomplish this task, do the following:

- Add the "total" filed to a chart's data source;
- Mark this filed as the tagField option;
- Calculate a percent value when showing a tooltip.


How to create a Master-Detail report

$
0
0

This example shows how the MailMerge feature enhanced with the DOCVARIABLE field specifics with the help of the RichEditDocumentServer text processing engine empowers the users to accomplish complex reporting tasks, such as creating Master-Detail reports.
The project uses a three-level Supplier-Product-OrderDetail hierarchical data source with the ITypedList interface, implemented as described in the E137: How to create a hierarchical master-detail datasource example. The XtraGrid GridControll is chosen to preview data because of its support for displaying hierarchical data sources in the most natural manner.

The application screenshot is shown below.

How to add the ASPxValidationSummary control to ASPxGridView's EditForm

$
0
0

This example demonstrates how to add the ASPxValidationSummary control to ASPxGridView's EditForm:

- Specify a custom EditFormTemplate;

- Replace auto-generated EditForm editors via the ASPxGridViewTemplateReplacement (ReplacementType=EditFormEditors);

- Add the ASPxValidationSummary control to collect EditForm Template validation errors;

- Perform the client-side EditForm Template validation via the client-side ASPxClientEdit.ValidateEditorsInContainer method.

ASPxGridView - How to implement ASPxProgressBar in DataCell and specify progress bar color based on a custom criteria

$
0
0

This example demonstrates how to define ASPxProgressBar in a column's DataItemTemplate and specify the progress bar color based on a custom criteria.

1) Define ASPxProgressBar in a grid column's DataItemTemplate;

2) Handle the ASPxProgressBar.DataBound event and set color via the ASPxProgressBar.IndicatorStyle.BackColor property based on a column value (or another custom criteria).

How to call an Action method via a custom button and pass a row's key as a parameter

$
0
0

- Define a custom button via the GridViewSettings.CommandColumn.CustomButtons collection;
- Customize the client-side CustomButtonClick event handler via the GridViewSettings.ClientSideEvents.CustomButtonClick property: pass the destination Url/Address (generated via the Url.Action helper method) as a parameter;
- Handle the client-side ASPxClientGridView.CustomButtonClick event;
- Retrieve the clicked row's keyValue via the client-side ASPxClientGridView.GetRowKey method. Use the EventArgs e.visibleIndex property as a parameter;
- Add the retrieved keyValue parameter to the specified destination Url;
- Navigate to the specified Url by changing the window.location.href property;
- Retrieve the passed keyValue via an argument of the invoked Action's parameter.

How to post data back to the database when editing series points in the WebChartControl

$
0
0

This example demonstrates how to update a database according to changes made in the gantt chart. The end user can move both start- and end-points of any gantt bar or drag and drop it within a diagram. All changes are persisted in the database. Data exchange is performed via regular ADO.NET objects.

See also:
Side-by-Side Gantt Demo
How to create a Gantt Chart in the ASP.NET application

Example Comments

Added By: Keith Richards at: 4/23/2013 7:32:15 AM    

does this example still work, as it's not working for me..

ASPxGridView - How to manipulate the control inside DataItemTemplate when a row is selected

$
0
0

This example demonstrates how to manipulate the control inside DataItemTemplate when a row is selected.

1) Define the ASPxSpinEdit editor inside a column's DataItemTemplate and bind the editor with a corresponding column value;
2) Handle the ASPxSpinEdit.Init event and set its unique ASPxSpinEdit.ClientInstanceName property based on the row's VisibleIndex;
3) Handle the client-side ASPxClientGridView.SelectionChanged event and manipulate the ASPxClientSpinEdit.SetEnabled property based on the row selection.

How to customize copy and paste commands

$
0
0

This example illustrates how to override CopySelectionCommand and PasteSelectionCommand behavior via the IRichEditCommandFactoryService substitution. This approach is based on the How to replace standard XtraRichEdit command with your own custom command example.

Customized CopySelectionCommand contains code for copying selection to the Clipboard in an HTML Clipboard Format (see the HtmlHelper.GetHtmlClipboardFormat() method), which is not implemented by default at the XtraRichEdit source code level. This allows you to copy RichEditControl content and paste it directly to a certain control that can accept HTML-formatted data from the clipboard (e. g. ASPxHtmlEditor). Note that images are embedded into resultant HTML according to the Data URI scheme specification to avoid dependency on the image location (it may not be resolved by the target application). Refer to the Building a mail application with the RichEditControl example to learn more on this approach.

As for customized PasteSelectionCommand, it simply retrieves plain (unformatted) text from the clipboard and pastes this text into the RichEditControl.

See Also:
SubDocument.GetText Method
SubDocument.GetRtfText Method
SubDocument.GetHtmlText Method


How to synchronize the GridControl and PrintPreviewWindow themes

$
0
0

This example demonstrates how you can set the PrintPreviewWindow theme to the currently selected GridControl theme. To do this, set the ThemeManager.ThemeName Attached Property in code:

[C#]
ThemeManager.SetThemeName(preview,ThemeManager.GetThemeName(gridControl1));

Note that in this scenario, the GridControl should be printed via the VisualDataNodeLink like in the How to specify certain page settings programmatically when printing a grid example so that you can access the PrintPreviewWindow (preview variable in this example).

Gauge - How to change options using the KnockoutJS approach

$
0
0

When using the Knockout approach to create a Gauge widget, some of the widget objects or all of them can be specified as ViewModel fields. Therefore, to get an option value, get a value of the corresponding ViewModel field. For example:


[JScript]
var viewModel = { linearGaugeOptions: { rangeContainer: { backgroundColor: 'green',...

[JScript]
var rangeContainerColor = viewModel.linearGaugeOptions.rangeContainer.backgroundColor;

However, if you require an option value that can be changed dynamically during an application flow and a widget that is updated in response to the option change, utilize observables. This example illustrates this approach in action:


[JScript]
var viewModel = { linearGaugeOptions: { scale: ko.observable({ majorTick: { showCalculatedTicks: false, customTickValues: [0, 15, 60, 100]}}),...

[JScript]
viewModel.linearGaugeOptions.title({ text: 'Title has been changed', position: 'top-left'}); viewModel.linearGaugeOptions.scale({ majorTick: { color: 'Red'}});

How to print DevExpress ASP.NET controls via XtraReports

$
0
0

This example illustrates how to print and/or export DevExpress ASP.NET controls by embedding them into an XtraReport.

In this example an ASPxGridView and WebChartControl are added to a report by using DevExpress.XtraReports.UI.PrintableComponentContainer objects.

How to apply theme to DevExpress control descendant

$
0
0

How to apply a theme to a DevExpress control descendant

To apply a theme to Customcontrol that uses some of DevExpress controls you need to apply a global theme for the page or for the entire application. In order to do that, use the ThemeDeployer tool to copy necessary files to your project folder. Note that our controls may use other simple controls, for example ASPxComboBox. So it is a good idea to copy files for all the controls.

After that you need to add some code to the page's Init event handler:

[C#]
formLayout.CssPostfix=this.Page.Theme;
The CssPostfix property is related only with DevExpress controls and cannot be used with standard ASP.NET controls.

How to expand visible group rows when the user searches using the Find Panel

$
0
0

This example demonstrates how to immediately show to the user found data when rows might be collapsed in groups. The straightforward approach to implement this feature is to handle the GridView.RowCountChanged event, and expand all records via the GridView.ExpandAllGroups method.

Sometimes, found data might contain a lot of rows, and expanding all rows can take a while. In this specific case, use the solution demonstrated in this example.

How to customize the Silverlight Report Designer

How to configure the report service client via the ServiceReferences.ClientConfig file

$
0
0

This sample shows how you can use the ServiceReferences.ClientConfig file to configure the report service client options.


SchedulerControl bound to MS SQL Server Database file and the DateNavigator control - a sample application

$
0
0

This sample application may serve as a starting point for exploring XtraScheduler features and characteristics. It contains SchedulerControl that uses MSSQL database file as the data source, DateNavigator control, Ribbon UI and the navigation bar.

How to create a DataItem template for a grid column at runtime

$
0
0

This example demonstrates how to create a simple hyperlink template programmatically. There is a MyHyperlinkTemplate class; it implements an ITemplate standard interface. A MyHyperlinkTemplate instance is created and assigned to a column's DataItemTemplate property on an ASPxGridView1_Load event.

See Also:
Creating Web Server Control Templates Dynamically

Example Comments

Added By: Muhammad Jamil 3 at: 10/9/2012 9:07:09 AM    

I have some different kind of scenerio where its creating serious issue. My data is coming from DataTables to bind which are dynamically created according to number of statuses we have. I used AutoGeneratedFields=true to display records, now I want to make them hyperlinks. Which is somehow achieved using help of following demonstration and its working fine. But problem is that when I open Child Detail Row, Parent Links disappear and only bound data remains, while Child doesnt disappear on viewing Subchilds.
Checked all events and life cycle etc but got no clue at all ion this regard. One thing I noticed is that in case of child view it cursor call Parent's DataBound while its perfectly calling on child and subchild and they are accurately showing hyperlinks.

How to implement BackstageButtonItem with ToggleButton behavior

$
0
0

We've created an example demonstrating how to implement a BackstageButtonItem with ToggleButton behavior.

This functionality is implemented via a BackstageButtonItem descendant. The BackstageButtonItem acquires the selected state when being clicked. When the BackstageButtonItem is double-clicked, a command assigned to it is executed.

How to implement drag and drop between a scheduler and a grid

$
0
0

This example illustrates how to implement drag and drop for appointments between a SchedulerControl and a GridControl. Note that we cannot use the approach from the How to implement drag and drop between a scheduler and a grid code example for this purpose because the Silverlight platform does not have the DragDrop.DoDragDrop() method and corresponding drag and drop events are not raised. Generally speaking, the Silverlight platform has very limited Drag and Drop capabilities. So, we are forced to use custom-made solutions. In this particular example, we reuse a separate DragAndDrop (DnD) library which was written by Azret: Silverlight Drag and Drop – v2010 vol 1.

ASPxSpellChecker - How to check an ASPxGridView editor in Inline edit mode

$
0
0

This example illustrates how to perform check spelling in a specific ASPxGridView editor in Inline edit mode:
- Hide the default Update and Cancel command buttons by handling the ASPxGridView.CommandButtonInitialize event;
- Define custom Update and Cancel buttons in order to provide a custom response when clicking them and prevent editing changes from immediate submission;
- Handle the client-side ASPxClientGridView.CustomButtonClick event. If the "Update" button is clicked, perform check spelling in a specific editor via the client-side ASPxClientSpellChecker.CheckElement method (pass the editor input element retrieved via the client-side ASPxClientEdit.GetInputElement method as a parameter);
- After the check spelling procedure is completed, submit the editing changes via the client-side ASPxClientGridView.UpdateEdit method.

Note that data modifications are not allowed in online demos. To allow editing in local/offline mode, download the example and comment out the "throw..." operation in the ASPxGridView.RowUpdating event handler.

Viewing all 7205 articles
Browse latest View live


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