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

How to: display axis labels between tickmarks

$
0
0
This example demonstrates how to display labels between tickmarks.

How to change the location of bar items within a Ribbon page group

$
0
0

This example shows how to change the location of bar items within a Ribbon page group. For this, we have created a custom RibbonControl.

To provide the capability to determine a BarItem location, we have created a special BarItemExtender component that implements the IExtenderProvider interface. Thus, you can set the BarItem location at design time. That is, any BarItem will have a new location in the BarItemExtender property if you place the BarItemExtender component onto the form.

To make a custom RibbonControl take the Location option into account, set the RibbonControlDescendant.BarItemExtender property to the BarItemExtender component located on your form.

Question Comments

Added By: sandeep deokar at: 12/21/2015 3:10:32 AM    

I created all required classes :BarItemExtender, RibbonControlDescendant, RibbonPageGroupComplexLayoutCalculatorDescendant & RibbonViewInfoDescendant and also dragged BarItemExtender  on my win form, but I don`t understood how to set set the RibbonControlDescendant.BarItemExtender property to the BarItemExtender.

Added By: Alisher (DevExpress Support) at: 12/21/2015 3:57:19 AM    

Hello,

To process your recent post more efficiently, I created a separate ticket on your behalf: T326923: How to change the location of bar items within a Ribbon page group. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.

How to customize a GridControl refreshing bar

$
0
0

This example demonstrates how to customize a color of the GridControl's refreshing bars (shown on Android and WinPhone) and refreshing icon (shown on iOS).

How to use WinUIDialogWindow and WinUIMessageBox controls

$
0
0

This Code Example demonstrates how to use the WinUIDialogWindow and WinUIMessageBox controls. The example contains two projects: one demonstrates how to use the controls in the MVVM pattern, and the other - in code behind. The first project uses special servicesWinUIDialogService and WinUIMessageBoxService. In the second project, the dialog and MessageBox are shown using the WinUIDialogWindow.ShowDialogWindow and WinUIMessageBox.Show methods.

Question Comments

Added By: Jaime López Portillo at: 1/14/2015 10:53:33 AM    

I can't seem to find any documentation regarding WinUIDialogWindow and WinUIMessageBox detailing their properties, constructors and methods, can you please provide me the full documentation link?

Added By: Andrey Marten (DevExpress Support) at: 1/14/2015 12:08:47 PM    

Hello,

To process your recent post more efficiently, I created a separate ticket on your behalf: T196769: Where the documentation for WinUIDialogWindow and WinUIMessageBox can be found. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.

Thanks,
Andrey

Added By: JRelyea at: 4/12/2015 10:21:13 AM    

I'm new to DevExpress.

Something seems to be very wrong with your example, as outlined below:

Something's not right with the following line because it constantly gets pounded and causes a sustained CPU usage at 30% (dual core 2.0gHz I7). Close the dialog window and the CPU drops back to 0%.

      bool OnRegisterCommandCanExecute(CancelEventArgs parameter) { return !string.IsNullOrEmpty(UserName); }

Do you have a working example that doesn't significantly impact a CPU? A dialog window should never consume CPU resources waiting to be closed.

Thank you

Added By: Andrey Marten (DevExpress Support) at: 4/13/2015 12:50:15 AM    


Hello,

To process your recent post more efficiently, I created a separate ticket on your behalf: T229667: WinUIDialogService - CPU usage increases if the command's CanExecute method is implemented. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.

Thanks,
Andrey

How to change connection to the database at runtime

$
0
0

This example shares some code that can be used to promote your application to another database after the application is already started. To accomplish this task, we have implemented two platform-dependent controllers that have the ChangeDatabase Action.

See also:
Database: How to show Business Classes from several databases in a XAF application

Question Comments

Added By: Mario Blatarić at: 11/5/2012 11:23:09 AM    

Let me give you "some reasons" why this isn't such a specific scenario.
 - accountant company doing accounting for several different companies (it's business requirement that data for each company is in separate database)
 - building maintenance company - again - business requirements demands each building to live in separate database (because of financial data)
 - document managment companies doing document management for multiple companies - again, each company must live in seperate database
 - local community combined with utility company - same people do both things and want to keep things separated

If you like, I can go on. No, you can't go to this companies / communities and say "But, it's better if we put all this to one database" because they will reply "Thank you, we'll find someone who can do it with multiple databases".
The point is, there are many reason why one piece of software should be connecting to multiple databases, so it's not such a specific scenario really. It would be nice to have this functionality out of the box instead of implementing this hard to understand piece of code.
Also, since application is distributed to many different clients, it would be nice that end-user could setup application on first startup (add/create required databases with connection info).

Added By: Mario Blatarić at: 3/14/2013 9:51:50 AM    

This example doesn't work.
Go to WinChangeDatabaseController.cs and set breakpoint in changeDatabaseAction_Execute. This code never executes since created SingleChoiceAction is not visible on logon form, instead some default editor is created with PredefinedValues and it's behaviour is not modified.
Can you fix this code please?

Added By: Dennis (DevExpress Support) at: 3/28/2013 4:52:33 AM    

@Mario: I have answered you in www.devexpress.com/issue=Q484359
This example worked correctly in my tests. In any event, I have just updated it to .NET Framework 4.0, just for more convenience.

Added By: Mario Blatarić at: 3/28/2013 6:17:17 AM    

Thanks Dennis. I understand now how this works.

Added By: lekan odejimi at: 1/29/2014 1:28:06 AM    

Hi Dennis, each time i try to logon i keep on getting this error: "Make sure your user name is correct and retype the password in the correct case." What do you suggest?

Added By: Grégoire Perruchoud at: 3/20/2014 9:52:00 AM    

Hi,

Great piece of code !

I noticed a weakness. In Web/Win controllers, preselection of correct item is done via following code :
if (Application.ConnectionString.Contains((string)item.Data))

This fails in case database name's string is contains elsewhere in ConnectionString. It also fails in case we have multiple databases with names containing each other, for example "customers" and "customers_geneva".

We should store the current database name in a static property somewhere and make a strong comparison.

Added By: Achmad Mulyadi at: 8/15/2015 12:11:19 AM    

Hi Dennis,

From the code below,

public const string Databases = "ChangeDatabase_DB1;ChangeDatabase_DB2";

Is there anyway I can pass a dynamic attribute value? I know this attribute requires a fixed value in compile time, but I don't think it is practical to put the database name or maybe a server address in a hard coded way. For example, it would be very practical if we can read this value from the app.config file, and pass it to the ModelDefault attribute.

Added By: Dennis (DevExpress Support) at: 8/17/2015 8:12:50 AM    @Achmad: Sure, please check out a possible solution at How to make example E1344 work with runtime defined databases. I hope this meets your needs.Added By: Robert Sanford at: 12/21/2015 3:36:59 PM    

Hi Dennis,
Would it be possible to post a complete XAF solution that incorporates this logic please along with tutorial? I have a single database XAF app that now has multiple database requirement - the various sql server databases would be defined in web.config. Thanks

How to customize the default Find Panel filtering algorithm

$
0
0

Find Panel uses an extended syntax that allows you to specify complex criteria. You can find detailed information here:
- Find Panel

However, sometimes it is necessary to exclude/include some rows in the resulting list according to your custom logic. In this case, you can filter rows manually by handling View.CustomRowFilter Event. This example demonstrates how to construct your own filter criteria and use ExpressionEvaluator to check whether a row should be hidden.

For demo purposes, this example just shows how to find exact matches of a typed string. The same result can be accomplished with the default behavior if you enclose your text in double quotes in Find Panel. To provide your own logic, just modify the MyConvertFindPanelTextToCriteriaOperator method as your needs dictate.

Question Comments

Added By: Sigol at: 9/6/2012 2:34:45 PM    

In the text above "if you enclose your text in commas in Find Panel" I think should read "if you enclose your text in DOUBLE QUOTES in Find Panel".

Added By: Arnaud Chevallier at: 12/21/2012 5:35:48 AM    

This may be usefull, as for example replacing parenthesis by double quotes. However with this method the results are not highligted anymore. Is there any workaround ?

Added By: Mu XU at: 7/17/2013 8:19:11 AM    

can't resolve DxFtsContainsHelperAlt in dx 11

Added By: Catalin Zainescu at: 12/21/2015 4:07:00 PM    

The suggested workaround feels more like black magic... For example, can you guarantee that "ColumnView.GetFindToColumnsCollection" method will always be there?

Do you have any plans to add an option to change this default filtering behavior? At the very least, it would be really nice to be able to switch from "OR" to "AND" filtering logic instead of having to add "+" to every token.

XL Export API - Examples

$
0
0

This example demonstrates how to use the XL Export API to create spreadsheet files in XLSX, XLS and CSV formats.

This project introduces API properties and methods used to perform the following operations:
- Create a workbook, worksheets, rows, columns and particular cells
- Apply predefined, themed and custom formatting to worksheet cells
- Apply conditional formatting rules
- Enable filtering and group data
- Apply data validation rules
- Assign formulas to worksheet cells
- Specify page settings
- Specify print options
- Insert pictures
- Insert hyperlinks
- Specify document properties

Starting from v2015 vol.2:
- Insert and modify sparklines
- Apply different fonts to specific text regions within a cell
- Create image hyperlinks
- Display a worksheet from right to left

Question Comments

Added By: Piotr Tworek at: 12/21/2015 11:34:23 PM    

Hi
This project not compatible with version VS 2010 pro
Piotr

How to automatically append a new row when a user presses the Enter or Key tab in the last cell

$
0
0

This example illustrates how to force GridView to automatically append a new row when an end-user finishes editing the last cell in GridView.

Question Comments

Added By: Eunsuk Choi at: 12/21/2015 6:12:40 PM    

If when i make a sort then addNewRow() is not work.

Added By: Andrew Ser (DevExpress Support) at: 12/22/2015 12:20:20 AM    Hello,
I've created a separate ticket for your inquiry. Let's discuss this issue in the Grid - A new row is not added if sorting is applied in E3810 ticket.

How to: use a custom date-time measure unit in an automatic scale mode

$
0
0
This example demonstrates how to specify a custom date-time measure unit in an Automatic scale mode.

How to: use a custom numeric measure unit in an automatic scale mode

$
0
0
This example demonstrates how to specify a custom numeric measure unit in an Automatic scale mode.

How to enable scrolling for tab headers in DXTabControl using ScrollView

$
0
0

DXTabControl can be used with different views. In this example, it's demonstrated how to use TabControlScrollView. In the scroll view, tab headers are displayed in a single line. When headers don't fit into the Tab Header Panel, scroll buttons are displayed.
In TabControlScrollView, tab headers can be displayed horizontally and vertically. To control this, use the TabControlScrollView.HeaderOrientation property.

How to define a custom IConnectionStorageService in DashboardDesigner Wizard to filter out unnecessary connections from an app.config file  

$
0
0

This example demonstrates how to implement a custom IConnectionStorageService and use it instead of the default one in the data source wizard. This service implementation allows only getting connection parameters from the DashboardDesigner.CustomDataConnection collection. To load the custom service instead of the default one, execute the following code:

[C#]
dashboardDesigner1.ServiceContainer.RemoveService(typeof(IConnectionStorageService));dashboardDesigner1.ServiceContainer.AddService(typeof(IConnectionStorageService),newCustomConnectionStorageService(dashboardDesigner1));

Note that starting with version 15.2 the connection from the app.config are not used by default. To enable this functionality use the DashboardDesigner.DataSourceWizardSettings.ShowConnectionsFromAppConfig Property

How to show tab headers in DXTabControl in multiple lines using MultiLineView

$
0
0

DXTabControl supports multiple views. In this example, TabControlMultiLineView is used to display tabs in multiple lines when tab headers don't fit into the Tab Header Panel. 
TabControlMultiLineView has all functionality available in TabControlViewBase and has two additional options to control behavior of tab headers:
-FixedHeaders - when this option is enabled, tab headers are not reordered when a tab is selected
-HeaderAutoFill - gets or sets whether tab headers are automatically stretched when there is empty space in the Tab Header Panel

(OBSOLETE) DashboardDesigner - How to customize the data source wizard to allow specifying a custom data source name

How to use RichEditDocumentServer for automatic document conversion

$
0
0

This example illustrates the use of the RichEditDocumentServer to convert files from Word 2007 format to RTF format.
The RichEditDocumentServer is a non-visual equivalent of the RichEditControl for working with documents via API.
Its advantages become evident in a simple application that automatically loads MS Word documents in a specified folder and its subfolders and saves them in Rich Text format. When a document is loaded, you can modify it in many ways, including mail merge.
Review the E3099: How to use document variable (DOCVARIABLE) fields example for more information.



How to Convert Between Metric and US Units of Measurement

$
0
0

This example illustrates the use of a QuantityValue<T> object and the Unit Conversion Library converters for calculating the volume and the mass of water in aquarium tank and displaying the results using US and metric units.
The Universal Subscription or an additional Document Server Subscription is required to use this example in production code. Please refer to the DevExpress Subscription page for pricing information.

How to display an XLSX document on the webpage

$
0
0

This example illustrates how to load a document into a Workbook Class instance and display its sheets on the webpage. Note that this approach is also used in our demos.

The Universal Subscription or an additional Document Server Subscription is required to use this example in production code. Please refer to the DevExpress Subscription page for pricing information.

Compression Library Examples

$
0
0

This example contains code snippets used in help articles on Document Automation Library for Zip Compression.
For more information see Documentation Online.

The Universal Subscription or an additional Document Server Subscription is required to use this example in production code. Please refer to the DevExpress Subscription page for pricing information.

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.

The Universal Subscription or an additional Document Server Subscription is required to use this example in production code. Please refer to the DevExpress Subscription page for pricing information.

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.

The Universal Subscription or an additional Document Server Subscription is required to use this example in production code. Please refer to the DevExpress Subscription page for pricing information.

Viewing all 7205 articles
Browse latest View live


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