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

How to apply conditional formatting to a range of cells

$
0
0

This example illustrates how to get started with conditional formatting that can be applied to cells that match a certain condition specified by a conditional formatting rule.

In particular, this sample demonstrates how to use the Spreadsheet Document Server API to create the following types of conditional formatting rules:

- a rule that formats cells whose values are above or below the average;

- a rule that highlights cells whose values are between or not between two specified values;

- a rule that formats top or bottom ranked values;

- a rule that highlights cells containing the given text;

- a rule that formats unique or duplicate values, blank cells and formula errors;

- a rule that highlights cells containing dates in the specified time period;

- a rule that formats cells whose values meet the condition expressed by the relational operator;

- a rule that uses a formula to determine which cells to format;

- a two-color scale conditional formatting rule;

- a three-color scale conditional formatting rule;

- a data bar conditional formatting rule;

- an icon set conditional formatting rule.


ASPxComboBox - How to implement cascaded combo boxes when using a large data source

$
0
0

This example demonstrates how to implement cascaded combo boxes scenario when a child ASPxComboBox operates in a Dynamic List Population mode

1) Enable a "child" ASPxComboBox "Dynamic List Population" mode by setting the EnableCallbackMode property to "true"
2) Implement both the ASPxComboBox.OnItemRequestedByValue event and the ASPxComboBox.OnItemsRequestedByFilterCondition events of the "child" ASPxComboBox;
3) Handle the client-side ASPxClientComboBox.SelectedIndexChanged event of the "parent" ASPxComboBox;
4) Perform a custom callback of the "child" ASPxComboBox via the client-side ASPxClientComboBox.PerformCallback method to update the underlying "child" data.

How to save and restore custom properties, defined in the PivotGridControl descendant, together with its layout

$
0
0

NOTE: This example was created for older XtraPivotGrid versions. The demonstrated solution is appropriate for versions prior to v2011.1.

Generally, to serialize a property of the DevExpress control, it is enough to mark it with the XtraSerializableProperty attribute (see How to serialize a custom property of the DevExpress control's descendant). However, this approach will not work in PivotGridControl since the PivotGridData object, not the PivotGridControl itself, is serialized. So, to accomplish this task, it is required to define the property in PivotGridData, and refer to this property in PivotGridControl. Please see the example's code to see how this should be implemented.

Starting with version 11.1, it is sufficient to decorate properties declared in the PivotGridControl descendant with the XtraSerializableProperty attribute:

[C#]
publicclassMyPivotGrid:PivotGridControl,IXtraSupportDeserializeCollectionItem{privateList<Class1>_Objects=newList<Class1>();[XtraSerializableProperty(XtraSerializationVisibility.Collection,true)]publicList<Class1>Objects{get{return_Objects;}}privateClass1_Object=newClass1();[XtraSerializableProperty(XtraSerializationVisibility.Content)]publicClass1Object{get{return_Object;}}#region IXtraSupportDeserializeCollectionItem MembersobjectIXtraSupportDeserializeCollectionItem.CreateCollectionItem(stringpropertyName,XtraItemEventArgse){if(propertyName=="Objects"){Class1class1=newClass1();Objects.Add(class1);returnclass1;}elsereturnnull;}voidIXtraSupportDeserializeCollectionItem.SetIndexCollectionItem(stringpropertyName,XtraSetItemIndexEventArgse){}#endregion}

How to customize a popup menu of the WPF Spreadsheet control

$
0
0

This example demonstrates how to customize Spreadsheet control popup menus.

How to Filter Lookup List Views

$
0
0

This example demonstrates how to display a collection of a particular reference property in a drop-down window of the Lookup Property Editor that displays another reference property. For details, refer to the How to: Filter Lookup List Views topic in XAF documentation.

Example Comments

Added By: Andrew Bingham 2 at: 3/3/2014 1:51:14 PM    

I have a concern about the UIX. 2 scenarios:

A. Code as given. When the Product is changed - the Accessory selected for the previous Product is still displayed in the View , until the user Tabs off the Product

B The Product property is decorated with the [ImmediatePostData] attribute. When the Product is changed - the Accessory is cleared in the View.

I can see valid arguments for both of these - I favour B on the principle that "the UI should never tell lies"

Thoughts ?

Added By: Konstantin B (DevExpress) at: 3/3/2014 11:57:01 PM    

Andrew, it is up to you whether or not the ImmediatePostData attribute should be applied in your scenario. It may be important to provide a responsive UI and update dependant property values immediately. In other cases, the scenario may be to update dependent values only after commit. These values may be located on another Detail View tab, or you may want to avoid postbacks when changing focus to improve performance.

How to serialize parameters of custom types

$
0
0

This example demonstrates the capability to provide XML serialization of custom parameter types.

In particular, it shows how you can save a report, along with its parameters of the System.Enum type, to XML file.

To do this, override the ReportStorageExtension class, and register a custom ReportDesignExtension, which implements the data source serialization functionality.

To serialize custom objects and properties, specify the XtraSerializableProperty attribute with the XtraSerializationVisibility.Reference parameter (this parameter defines whether or not an object should be serialized by a reference).

How to build a native package in Visual Studio

How to bind the XRChart control to the report's detail data when a report is bound to the ORM(Entity Framework) data source

$
0
0

This example demonstrates how to bind the report's XRChart control to detail data when a report is bound to the collection of data classes. The Entity Framework ORM is used in this example as a report's data source.


The BindingSource controls are used in this example to provide a data class shema to the XtraReport and XRChart control at design time. To provide data to the report at runtime, the DataSourceDemanded event handler is used. The XRChart.BeforePrint event handler is used to get a data object corresponding to the current row and bind the XRChart control to the data.


Note that this example is built on the ASP.NET WebForms technology. However, our XtraReports suite is a cross-platform product, so you can use the same approach in other .NET applications.


ASPxTokenBox - How to remove items from drop-down after selection

$
0
0

This example illustrates how to show only items that were not selected in the item collection. I.e. all items that were selected will be removed from the drop-down window, and unselected items will be added there again.

How to activate panels via ViewModel

$
0
0

This example shows how to activate a panel via two-way binding in the BaseLayoutItem.IsActive property. After changing an active panel, a corresponding ViewModel is activated. And after changing the active ViewModel, the active panel is passed to DockLayoutManager.

How to save the text of a document range in different formats

$
0
0

This example illustrates API methods used to get the text of the document range in different formats - RTF, HTML, MHT, DOCX.
Although the preferable technique to save the document in different formats is the SaveDocument and the SaveDocumentAs methods, several methods allow obtaining text of the specified range in different formats. Current example provides code snippets which use these methods. Note the implementation of the IUriProvider interface required for HTML export.

GridView - How to allow end-users to resize the grid(MVC)

$
0
0

This example is an implementation of the E5057: ASPxGridView - How to allow end-users to resize the grid example for the MVC platform.
The example supports both postponed (when the control's frame is rendered and resized on a mouse move, and the control is actually resized after the mouse button is released) and real time resizing (when the control is resized on mouse move). Set the 'postpone' JavaScript variable to 'false', to allow real time resizing.

ASPxGridView - How to allow end-users to resize the grid

$
0
0

The scenario is the following:
- Set the ASPxGridView.SettingsPager.Mode property to 'ShowAllRecords';

- Set the ASPxGridView.Settings.ShowStatusBar to 'Visible' and the ASPxGridView.Settings.VerticalScrollBarMode property to 'Auto';

- Change the ASPxGridView's height and width in the mouse move event handler.


The example supports both postponed (when the control's frame is rendered and resized on mouse move, and the control is actually resized after the mouse button is released) and real time resizing (when the control is resized on mouse move). Set the 'postpone' JavaScript variable to 'false', to allow real time resizing.

See also

GridView - How to allow end-users to resize the grid(MVC)

How to localize ASPxScheduler dynamically

GridView - How to toggle Auto Filter Row visibility

$
0
0

This example illustrates how to toggle the Auto Filter Row visibility via a custom MVC GridView callback.

- Initialize the expected Auto Filter Row visibility via the ViewData key when a View is loaded for the first time;
- Set the CheckBox state according to the ViewData key value;
- Load the GridView's PartialView via the Html.Action method and pass the ViewData key as a parameter;
- Set the Auto Filter Row visibility according to the ViewData key;
- Handle the client-side ASPxClientCheckBox.CheckedChanged event;
- Perform a custom GridView callback via the client-side ASPxClientGridView.PerformCallback method;
- Handle the client-side ASPxClientGridView.BeginCallback event;
- Pass the CheckBox' checked state as a parameter (Passing Values to Controller Action Through Callbacks);
- Handle the GridViewSettings.CustomActionRouteValues.Action method and retrieve the passed parameter. In general, it is possible to use the Action method specified for all GridView callbacks (GridViewSettings.CallbackRouteValues.Action). The illustrated technique allows handling a custom GridView's callback within a separate Action method, whose signature can be different. Usually, custom callbacks are used for changing the GridView's state programmatically in a custom manner (like here - toggling the Auto Filter Row visibility);
- Pass the required Auto Filter Row visibility state via the ViewData key back to the GridView PartialView.


How To: Create WidgetView at runtime

$
0
0

This example demonstrates how to create and customize WidgetView with 2 StackGroups at runtime.

WinForms SpreadsheetControl API

$
0
0

This example demonstrates how to use the SpreadsheetControl 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, copy, adjust worksheet view, etc.)

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

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

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

- Format cells (set cell font, colors, alignment, borders, number format, etc.)

- Export the workbook to PDF

- Print the workbook


How to use the XRPivotGrid control to create a cross-tab report

$
0
0

The following example demonstrates how to use the Pivot Grid control to generate a cross-tab report in code.

See also:
- How to fit the XRPivotGrid on a page;
- How to use the XRPivotGrid control's Print* events to conditionally adjust its appearance in Print Preview;
- How to implement the best fit method for XRPivotGrid's column field values;
- How to create custom total columns in xrPivotGrid at runtime;
- How to sync ASPxPivotGrid and XRPivotGrid.

Example Comments

Added By: joel wako at: 11/22/2012 12:34:56 AM    

Hi everyone,
how can i achieve this in an aspx page?
Thanks!

How to customize the Silverlight Report Designer

How to apply filtering to a dashboard item's data in OLAP mode

$
0
0

The following example demonstrates how to apply filtering to a dashboard item's data in OLAP mode.


In this example, constant values and dashboard parameters are passed to a filter string to filter a dashboard item's data.

In OLAP mode, a limited number of criteria operators are supported. This example shows how to use the supported criteria operators.


Viewing all 7205 articles
Browse latest View live


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