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

How to create custom theme for DXTabControl

$
0
0

This example shows how to customize main visual elements of the DXTabControl by overriding styles. 

You can read an article that describes this approach: KA18580: How to modify DX themes in WPF Refer to it for more information.

Update

In the 15.1 release, we introduced new customization capabilities. Refer to the T245606 example to learn more.

Question Comments

Added By: Jeffrey A. Mazur at: 3/22/2013 8:39:17 AM    

You've got to be joking. (FYI, I was referred to this page from Q430835, as was the poster of that question.) I cannot believe the audacity it takes to just point someone in the direction of a massive block of code with no comments or explanatory text, leaving paying users to fend for themselves, having to wade through reams of documentation to extract the definition and proper use of dozens of classes themselves.

The mentality of tool builders is infantile in its selfishness. No other group of "professionals" has such a blatant disregard for the needs of their customers. "Oh, well, the code is self-explanatory" just doesn't cut it - we paid lots of money for your product to SAVE OURSELVES TIME, not to shift our burden from one labyrinthine puzzle to another.

So how about a brief explanation of what the heck is going on here in this code?

Added By: Andrey K (DevExpress Support) at: 12/26/2014 7:16:16 AM    Hello Jeffrey,

We accidentally discovered that your initial post was out of scope of our Support Center for a long time. Please accept our sincere apologies for not responding in a timely manner.I've created a separate ticket on your behalf regarding the task you've mentioned in your message to process it more efficiently: T191241: How does the E3168 example work

If this task is still important for you, please find a couple of minutes to refer to that thread.

Thanks,
Andrey

OBSOLETE - How to collapse large editors in the Detail View on the Web

$
0
0

===========================
This example is now obsolete. Instead, refer to the How do I provide an option to collapse or expand layout groups? article for more details on the recommended solution.
===========================
Sometimes when your detail view contains a lot of editors, it is necessary to effectively use the space on the page. For example, usually editors in which collection properties are shown take a lot of space. You can reduce the space if you provide the capability to collapse large editors.
In this example, I show how to put a large editor into the ASPxNavBar control that can expand/collapse its groups.

See Also:
Access Editor Settings

How to customize LayoutControl's CustomizationPopup

$
0
0

This example demonstrates how to customize LayoutItemCustomizationToolbar.

For more information on how to accomplish this task in Silverlight, see T245666.

How to customize LayoutControl's CustomizationPopup

$
0
0
This example demonstrates how to customize LayoutItemCustomizationToolbar.

For more information on how to accomplish this task in WPF, see E3551.

How to create SubMenu's items from a data collection

$
0
0

This example demonstrates how to populate the menu based upon a specific data source using a data-binding mechanism.

To learn more on how to implement similar functionality in Silverlight, refer to the T245564 example.

How to reset View customizations made by end-users

$
0
0

Scenario
A new Reset View Settings Action is added into the toolbar that allows end-users to reset customizations made in root Views (this approach is not suitable for nested ListViews).
This functionality can be helpful if your end-users break the default layout, and after that, they want to restore it back.

Steps to implement
1. Copy the ...\WinSolution.Module.Win\ResetSettingsViewController.xx file into YourSolution.Module.Win module project.


See also:
How to save the currently opened View as a new View Variant at runtime

Question Comments

Added By: Juan Pallas Ribes at: 5/22/2015 4:24:40 AM    

I want to reset customizations in nested listviews, so I set targetViewNesting = Nesting.Any. After executing action in a nested listview, all objects are loaded, instead of objects related to the master object.

How can I reset customizations in nested listviews?

Thanks

Added By: Dennis (DevExpress Support) at: 5/22/2015 6:31:17 AM    

@Juan: This approach is not suitable for nested ListView, I am afraid. At the moment, I can only recommend you recreate the whole parent DetailView if you have updates to its nested ListView.
>>I want to reset customizations in nested listviews,
Would you please also describe your specific use-case scenarios from an end-user perspective? I am asking because there may be different technical solutions.

How to hide certain columns in the Timeline view (implement a custom scale)

$
0
0

Problem:

I'd like to hide columns for certain (non-working) hours in the TimelineView. How can I accomplish this?

Solution:

You can implement a custom time scale. It enables you to hide unneeded time periods.
A custom time scale class is inherited from the TimeScale class, overriding methods for the DateTime data handling and formatting.
You should override the following properties and methods:
SortingWeight - used to compare time scales;
Floor - specifies column boundaries;
HasNextDate - checks whether the move to the next date is allowed;
GetNextDate - navigates to the next date;
DefaultDisplayFormat - specifies the format for the column header caption;
DefaultMenuCaption - specifies the caption for the context menu item which enables this time scale;
FormatCaption - returns a string to be displayed as a column header caption.

To ensure a proper alignment of an upper (Day) scale, create a descendant with the Floor method overridden. Add this descendant to the scales collection in place of the default TimeScaleDay scale.

Question Comments

Added By: Lars Wuckel HHK at: 5/22/2015 7:20:57 AM    

There is an painting and end-time-calculation issue.

paint issue
If I create an all-day appointment the appointment will be painted that it would start at the last hour of the day before.

calc issue
If I create an appointment at the last hour of the day the end-time is the first hour of the next day.

Added By: Oleg (DevExpress Support) at: 5/22/2015 7:58:39 AM    

Hello Lars,
To process your recent post more efficiently, I created a separate ticket on your behalf: T245859: Issues with rendering and calculating appointment properties when a custom time scale is used. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.

How to handle GridControl's events at the ViewModel level using the EventToCommand extension from MVVM Framework

$
0
0
MVVM Framework provides a powerful EventToCommand feature that allows delegating event processing logic to the ViewModel level. This example illustrates how to use this functionality to process DXGrid events.

The EventToCommand class provides the PassEventArgsToCommand option that allows passing the corresponding EventArgs as a command parameter. However, it is not good MVVM practice (even though it might be necessary in certain cases) to make a ViewModel aware of event arguments. It is better to extract necessary information from event arguments and then pass this information as a command parameter. To do this, use EventArgsConverter.

So, this example demonstrates the following cases:

1) How to invoke a command from a ViewModel when an event is raised. In this example, the built-in BestFitColumns command is invoked when the View's Loaded event is triggered.

2) How to invoke a command from a ViewModel when an event is raised and pass event arguments as a command parameter. This approach is used to delegate processing the ShowingEditor event to the ViewModel level.

3) How to invoke a command from a ViewModel when an event is raised, extract necessary information from event arguments using a Converter and then pass it as a parameter. The View's MouseDoubleClick and FocusedColumnChanged events are processed in this manner.

Note this approach can be used for other controls as well. This example also illustrates how to process a BarItem's ItemDoubleClick event in this manner.

To implement similar functionality in WPF, see E3263.

How to use the PrintCellStyle property to customize cell's printing appearance

$
0
0

This example shows how to create custom PrintCellStyle for grid columns to bring a custom printing appearance for PopupImageEdit, CheckBoxEdit and MemoEdit.

To learn more on how to implement similar functionality in Silverlight, refer to the T245823 example.

How to handle GridControl's events at the ViewModel level using the EventToCommand extension from MVVM Framework

$
0
0

MVVM Framework provides a powerful EventToCommand feature that allows delegating event processing logic to the ViewModel level. This example illustrates how to use this functionality to process DXGrid events.

 

The EventToCommand class provides the PassEventArgsToCommand option that allows passing the corresponding EventArgs as a command parameter. However, it is not good MVVM practice (even though it might be necessary in certain cases) to make a ViewModel aware of event arguments. It is better to extract necessary information from event arguments and then pass this information as a command parameter. To do this, use EventArgsConverter.

 

So, this example demonstrates the following cases:

1) How to invoke a command from a ViewModel when an event is raised. In this example, the built-in BestFitColumns command is invoked when the View's Loaded event is triggered.

 

2) How to invoke a command from a ViewModel when an event is raised and pass event arguments as a command parameter. This approach is used to delegate processing the ShowingEditor event to the ViewModel level.

 

3) How to invoke a command from a ViewModel when an event is raised, extract necessary information from event arguments using a Converter and then pass it as a parameter. The View's MouseDoubleClick and FocusedColumnChanged events are processed in this manner.

 

Note this approach can be used for other controls as well. This example also illustrates how to process a BarItem's ItemDoubleClick event in this manner.

To implement similar functionality in Silverlight, see T245878.

How to force a GridLookUpEdit's drop-down window to filter records based upon all visible columns using the "contains" condition against an entered string

$
0
0

This example shows how to create a GridLookUpEdit's descendant whose drop-down window will select records whose fields contain a specified sub-string. Don't forget to specify the RepositoryItemLookUpEditBase.DisplayMember property.

See Also:
How to force the GridLookUpEdit to filter rows and show only those that contain a specified sub-string at least in one of displayed columns

Question Comments

Added By: CAD IT S.p.A. at: 5/23/2015 8:49:59 AM    

good work
how can i add a checked column to multiselect row?

How to enable Gantt view for the SchedulerControl bound to collection of business objects

$
0
0

This is a simple example of XtraScheduler bound to collection of custom business objects displaying Gantt view. This project also utilizes the ResourcesTree control to display a hierarchy of resources and the SplitContainer control to allow resizing of Scheduler and ResourceTree controls.

To accomplish this task, you should have three collections - for appointments, for resources and for appointments dependencies. All collections should implement the IBindingList interface. You can implement this interface manually in your custom collection, but we recommend you use the System.ComponentModel.BindingList<T> collection.

Additionally, your business objects should have properties suitable for mapping to the corresponding properties of XtraScheduler appointments, resources and appointments dependencies.

See also:
How to bind the SchedulerControl to a collection of custom objects
How to enable Gantt view for the XtraScheduler bound to MS SQL Server database

Question Comments

Added By: john van der putte at: 5/9/2015 11:41:07 AM    

i tried this example (both VB.NET and C#) with VS2010 but i get the error that it isn't compatible with this version of VS. Is there another simple example where i can learn how to make a gantchart with resourcetree without making use of a database for the resources and appointments.

Added By: Oleg (DevExpress Support) at: 5/11/2015 12:50:21 AM    

Hello John,
In the sample project we provided here, the Target Framework is set to 4.5. That is why this sample project can't be opened in Visual Studio 2010.
I changed the Target Framework to 4.0 and modified the sample project we posted here. Please check it and let me know whether or not this sample runs correctly on your side.
I am looking forward to your response.

Added By: john van der putte at: 5/11/2015 12:08:22 PM    

Hello Oleg,

The sample runs correctly with VS2010. Thanks.

Added By: Oleg (DevExpress Support) at: 5/11/2015 11:23:40 PM    You are welcome, John!
Do not hesitate to contact us if you have additional questions or need further assistance.Added By: john van der putte at: 5/24/2015 1:51:03 AM    

Oleg,

With this example i managed to get the resourcetree and gantview working in my application.
Is it possible to give the rows a constant height? I tried diverent things but they keep stretching with the height of the gantview

Report Storage for the End-User Report Designer

$
0
0

The following example demonstrates how to implement a report storage to persist report definitions in a database or in any other custom location. This may be useful when providing end-users with the capability to create and customize reports using XtraReports End-User Designer, if it is necessary to have a common target for saving and sharing all reports.

The default report serialization mechanism does not support the serialization of a report's data source. The following examples illustrate how you can provide a custom XML serialization logic for a report's data source as well as its custom parameters.

- How to implement custom XML serialization of a report that is bound to a dataset;

- How to serialize an XPO data source;

- How to serialize parameters of custom types.

Question Comments

Added By: (no info) at: 10/8/2012 10:48:21 AM    

There is a slight error in the example if you are using a different XPO provider. The call to create the XpoReportStorage is prior to setting the default DataLayer. This results in the default MS Access DataLayer being used in the XpoReportStorage parameter. Changing the statement (as indicated below) will result in the expected behavior:

string conn = SQLiteConnectionProvider.GetConnectionString(@"c:\temp\ReportStorage.sqlite");
XpoDefault.DataLayer = XpoDefault.GetDataLayer(conn, AutoCreateOption.DatabaseAndSchema);
reportStorage = new XpoReportStorage(new UnitOfWork());

Added By: Patrick Sollberger at: 7/6/2013 2:03:23 AM    

A hint for all those wo tried this with version 13.1.4:

This Example can not be built as-is using DevExpress 13.1.4 even after project conversion.

The ZipReportStorage.cs contains renamed classes:
- ZipFileCollection is now named InternalZipFileCollection
- ZipFile is now named InternalZipFile
- ZipArchive is now named InternalZipArchive

After renaming all occurences of those classes with the new names everything works just fine.

Added By: BINITR at: 10/25/2013 2:18:39 PM    

I'm trying to connect to the datasource Sqlite but I can not figure out how to do. I also downloaded the componeti OleDb for Sqlite but without result.

Added By: Wim Koppelaar at: 5/24/2015 2:59:21 AM    

Nice example of the possibillities. But I don't understand where StorageDataSet is comming from?

How to create SubMenu's items from a data collection

$
0
0
This example demonstrates how to populate the menu based upon a specific data source using a data-binding mechanism.

To learn more on how to implement similar functionality in WPF, refer to the E3032 example.

How to Save Grid Layout to and Restore It from a memory stream

$
0
0
This example shows how to save the grid layout to a memory stream. To do this, click the 'Save Layout' button. Once saved, the grid layout can then be restored by clicking the 'Restore Layout' button.

To learn more on how to implement similar functionality in WPF, refer to the E1655 example.


How to Save Grid Layout to and Restore It from a memory stream

$
0
0

This example shows how to save the grid layout to a memory stream. To do this, click the 'Save Layout' button. Once saved, the grid layout can then be restored by clicking the 'Restore Layout' button.

To learn more on how to implement similar functionality in Silverlight, refer to the T246174 example.

How to use custom printing templates

$
0
0
This example demonstrates how to use grid's printing templates to change the grid printing appearance.

To learn more on how to implement similar functionality in WPF, refer to the E3228 example.

How to use custom printing templates

$
0
0

This example demonstrates how to use grid's printing templates to change the grid printing appearance.

To learn more on how to implement similar functionality in Silverlight, refer to the T246198 example.

How to track filter criteria changes in the unbound FilterControl

$
0
0

By default, the FilterControl's FilterCriteria property is updated only after the ApplyFilter method has been called, while the ActualFilterCriteria property does not send notifications when the user changes the filter.

This sample project shows how to force an unbound FilterControl to update its FilterCriteria property and bind another control or a view model to this property.

 
To learn more on how to implement similar functionality in WPF, refer to the E3766 example.

How to track filter criteria changes in the unbound FilterControl

$
0
0

By default, the FilterControl's FilterCriteria property is updated only after the ApplyFilter method has been called, while the ActualFilterCriteria property does not send notifications when the user changes the filter.

This sample project shows how to force an unbound FilterControl to update its FilterCriteria property and bind another control or a view model to this property.

 
To learn more on how to implement similar functionality in Silverlight, refer to the T246246 example.

Viewing all 7205 articles
Browse latest View live


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