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

ASPxGridView - Batch Mode - How to submit changes and ASPxFormLayout's values at once


How to: Implement the report management functionality using StandaloneReportManagerService

$
0
0
Question Comments

Added By: Andrew King at: 2/22/2016 5:48:37 PM    Does the PerdefinedReport tag have a ItemsSource or similar that I can attach a collection of reports to?Added By: Andrey K (DevExpress Support) at: 2/23/2016 12:37:43 AM    Hi Andrew,

I have exported your question in a separate thread. Let's continue our discussion there:T348676: How to provide a PerdefinedReport items source

Thanks,
Andrey

How to: Change cell appearance based on its column and row index

$
0
0

It's possible to pass any value to the converter. In the Convert method the value of the property is passed, to which the Setter Value property was bound. To bind to the RowHandle.Value, use the following style:

<Style x:Key="customCellStyle" TargetType="dxg:CellContentPresenter">
   <Setter Property="Background"
           Value="{Binding Path= Data.RowHandle.Value,
           Converter={local:YourConverter}}"/>
</Style>

Note the data context of the cell style for the View is the RowData (RowData Members )
However, it's possible to bind to properties of the CellContentPresenter itself (CellContentPresenter Members ).

To bind to the GridColumn.VisibleIndex, write the following style:

<Style x:Key="customCellStyle" TargetType="dxg:CellContentPresenter">
   <Setter Property="Background"
           Value="{Binding Path= Column.VisibleIndex, RelativeSource={RelativeSource Self},
           Converter={local:YourConverter}}"/>
</Style>

Use multi binding, to pass two values to the converter. The sample illustrates how to use multi binding.

Update: Take special note of our Conditional Formatting as well.

How to: Activate the Instant Feedback Mode for the Grid Bound to an Entity Framework model

$
0
0

This example shows how to implement the Instant Feedback Mode (asynchronous data loading) for a grid bound to Entity Framework 4.0 Classes. To activate this feature, use our specially designed data source (EntityInstantFeedbackDataSource).

To start this example connect the Entity Data Model to the Northwind database.

Question Comments

Added By: Fayaz kolar at: 7/25/2012 3:31:44 AM    

This Example not working, giving Error "base {System.Exception} = {"The underlying provider failed on Open."}"

Added By: Andrey K (DevExpress Support) at: 12/26/2014 7:06:15 AM    Hello Fayaz,

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: T191237: This E3160 example not working
If this task is still important for you, please find a couple of minutes to refer to that thread.

Thanks,
Andrey

How to make it possible to reorder GalleryControl items using drag-and-drop

$
0
0

This example demonstrates how to implement the capability to reorder GalleryItems in the GalleryControl by using drag-and-drop.

To implement this feature, we created the EnableGalleryItemDragging attached property. You can use this property in your project in the following manner:


[XAML]
<dxb:GalleryControlMouseRightButtonUp="GalleryControl_MouseRightButtonUp_1"Name="galleryControl1"<bold>AllowDrop="True" </bold><bold>local:GalleryItemDragDropHelper.EnableGalleryItemDragging="True"</bold>><dxb:GalleryControl.Gallery><dxb:Gallery.....

                    

Also, it is necessary to set the GalleryControl.AllowDrop property to true.

Please note that the drag-and-drop operation succeeds if you drop a GalleryItem into another GalleryItem of the same GalleryItemGroup or another one. Otherwise, nothing will happen.

[Deprecated]How to override ColorScheme colors and support system themes (Light|Default)

$
0
0
Starting with v17.1, we provide a more powerful and flexible way of overriding predefined colors. Refer to the updated How to override default colors from an existing Color Scheme in Windows 10 XAML controls and support system themes (Light, Default)  example for more information.


This example illustrates how to override default colors from an existing color scheme in Windows 10 XAML controls and support system themes (Light, Default). In the current implementation, the background of the RibbonControl header is overridden in Generic and Win8 schemes and has different values in these schemes for the Default and Light system themes.

Colors should be overridden within a separate ResourceDictionary file and used in the Source property of the GlobalColorSchemeOverrider class.

Certain system theme colors must be declared in a separate ResourceDictionary in the color scheme ResourceDictionary's ThemeDictionary collection as follows: 

 

[XAML]
<ResourceDictionaryx:Key="Generic"><ResourceDictionary.ThemeDictionaries><ResourceDictionaryx:Key="Default"><SolidColorBrushx:Key="RibbonHeaderBackgroundBrush"Color="#FF164B2F"/> ...</ResourceDictionary><ResourceDictionaryx:Key="Light"><SolidColorBrushx:Key="RibbonHeaderBackgroundBrush"Color="#FF418366"/> ...</ResourceDictionary></ResourceDictionary.ThemeDictionaries> ... </ResourceDictionary>

  

Note: 
1. Our controls have the same appearance in different system themes when the Win8 color scheme is applied. System themes are supported in our controls out of the box only when the Generic color scheme is applied. 
2. The Dark system theme is determined as Default and colors in the Generic color scheme for both these themes are the same.

 
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 override default colors from an existing Color Scheme

$
0
0
Starting with v17.1, we provide a more powerful and flexible way of overriding predefined colors. Refer to the updated How to override default colors from an existing Color Scheme in Windows 10 XAML controls example for more information.

This example illustrates how to override default colors from an existing color scheme in Windows 10 XAML controls. In the current implementation, the background of the RibbonControl header is overridden to #FF217346 in the Generic scheme and to #FF093467 in the Win8 scheme.

Colors should be overridden within a separate ResourceDictionary file. Then, this dictionary should be 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

How to emulate Binding to the IsExpanded property of the TreeListNode

$
0
0

Because the TreeListNode’s IsExpanded property is not a DependencyProperty, there is no way to create TwoWay binding between the IsExpanded and data source item’s property. The example demonstrates how to emulate this functionality using behaviors.

BindableExpandingBehavior class attaches to a GridControl to provide the functionality. The BindableExpandingBehavior’s ExpandingProperty must be set and has to contain the name of the property in a data item, which will be used to expand/collapse the TreeListNode. The type of the property has to be Boolean.

The behavior will be automatically enabled for each level in TreeListView where a data item contains the same property name set in the BindableExpandingBehavior’s ExpandingProperty.

You can easily add the same functionality to your project using BindableExpandingBehavior class and attaching it as a behavior to your GridControl.


How to provide custom images for the CheckEdit control in the GridControl

$
0
0

Implement a ControlTemplate with the Image property. In the ControlTemplate, implement a DataTrigger, and change the Image Source property when cell value is True. Assign this ControlTemplate to the GridColumn.EditTemplate and GridColumn.DisplayTemplate properties.

Question Comments

Added By: Lokesh Sharma 3 at: 3/23/2015 4:56:40 AM    

Hello
I got error when i use png format image source property and also i want set image on IsThreeState is true

Added By: Alexander S (DevExpress Support) at: 3/23/2015 12:16:28 PM    Hello,

To process your recent post more efficiently, I created a separate ticket on your behalf: T222793: How to use PNG images for tree-state check boxes in E2628. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.Added By: David Lemieux at: 12/1/2015 4:17:39 PM    

Is this still the way to go, with optimized mode introduced a while back and all?

Also, is the "slider" standalone checkbox required in any way for the grid to work as expected?

Added By: Andrey Marten (DevExpress Support) at: 12/1/2015 11:19:45 PM    


Hello David,

To process your recent post more efficiently, I have created a separate ticket on your behalf: T319388: How to provide custom images for the CheckEdit control in the GridControl. Let's continue our discussion there. 


Thanks,
Andrey

Win Viewer - How to apply default filtering to master filter items that affect each other

$
0
0
The DashboardViewer control allows you to apply default filtering using the following events:
- MasterFilterDefaultValues.
- RangeFilterDefaultValue.
FilterElementDefaultValues (v16.1 and earlier).
- SingleFilterDefaultValue (v16.1 and earlier).
If your dashboard contains several master filter items that affect each other, filtering may not be applied to some items due to architectural limitations of DevExpress Dashboard. Let's consider the following scenario: a dashboard contains the Grid and Card dashboard items that affect each other. If you handle the MasterFilterDefaultValues event for both items, filtering will not be applied to the Extended Price column of Grid 1:
code:
[C#]
privatevoiddashboardViewer1_MasterFilterDefaultValues(objectsender,MasterFilterDefaultValuesEventArgse){if(e.ItemComponentName=="gridDashboardItem1")e.FilterValues=e.AvailableFilterValues.Where(v=>(string)v["CategoryName"]=="Beverages"||(string)v["CategoryName"]=="Condiments");if(e.ItemComponentName=="cardDashboardItem1")e.FilterValues=e.AvailableFilterValues.Where(v=>(string)v["Country"]=="UK");}
 result:



As a workaround, you need to call the SetMasterFilter method for Cards 1. In this case, filtering will be applied correctly:
code:
[C#]
dashboardViewer1.SetMasterFilter("cardDashboardItem1",newList<object>(){"UK"});// ...privatevoiddashboardViewer1_MasterFilterDefaultValues(objectsender,MasterFilterDefaultValuesEventArgse)if(e.ItemComponentName=="gridDashboardItem1"){e.FilterValues=e.AvailableFilterValues.Where(v=>(string)v["CategoryName"]=="Beverages"||(string)v["CategoryName"]=="Condiments");}
result:

How to apply conditional formatting to Grid cells using the Gradient Ranges condition

$
0
0

The Range Gradient condition (FormatConditionRangeGradient) allows you to use predefined color gradients to apply conditional formatting to different ranges of values.

This example shows how to apply conditional formatting to Grid cells using the predefined Red-Blue color gradient. Use the Update Formatting button to change start/end colors and the number of ranges in the color gradient. The third color in the middle of the color scale is also specified to generate a 3-color gradient.

ASP.NET MVC Dashboard - How to provide data to ObjectDataSource using DataLoading

WinViewer - How to obtain a dashboard item's underlying data for a clicked visual element

$
0
0

The following example demonstrates how to obtain underlying data corresponding to a particular visual element using the DashboardViewer's API.

In this example, the DashboardItemDoubleClick event is handled to obtain underlying data and display this data in the grid.

In the event handler, the GetUnderlyingData method is called to obtain records from the dashboard's data source.

How to save custom settings to a dashboard XML and apply these settings in the Viewer

$
0
0

The following example shows how to save custom settings to a dashboard XML definition in the Dashboard Designer and apply these settings in the Dashboard Viewer.

This example contains four projects - the Dashboard Designer and three types of the Dashboard Viewer: WinForms, Web and MVC. In the Designer, you can change the font size of chart legend items. The DashboardItemControlUpdated event is used to access the underlying Chart control in the Dashboard Designer and change the font size of legend items. The Dashboard.UserData property provides the capability to save this value to the dashboard XML definition. Finally, dashboard definitions included in Dashboard Viewer projects are updated using the Dashboard.SaveToXml method.

In Dashboard Viewer projects, special members are used to access underlying controls and apply the custom font size:

- In the WinForms DashboardViewer, the DashboardItemControlUpdated event is used to access the underlying chart control.

- In the Web/MVC Viewer, the ItemWidgetCreated event is used to access the underlying dxChart widget. The CustomJSProperties event is handled to send custom data from the server to the client.

Note that changing specific control/widget settings may lead to various issues. To learn more, see the following topics:
Access to Underlying Controls
Access to Underlying Widgets

ASPxDashboard - How to show a dashboard item's data for a clicked visual element

$
0
0

This example demonstrates how to obtain client and underlying data corresponding to a particular visual element and display this data in a popup. You can click individual cards within the Card dashboard item to see detailed information.


Web Viewer - How to apply default filtering to master filter items that affect each other

$
0
0
The ASPxDashboardViewer control allows you to apply default filtering using the following events:
- MasterFilterDefaultValues.
- RangeFilterDefaultValue.
FilterElementDefaultValues (v16.1 and earlier).
- SingleFilterDefaultValue (v16.1 and earlier).
If your dashboard contains several master filter items that affect each other, filtering may not be applied to some items due to architectural limitations of DevExpress Dashboard. Let's consider the following scenario: a dashboard contains the Grid and Card dashboard items that affect each other. If you handle the MasterFilterDefaultValues event for both items, filtering will not be applied to the Extended Price column of Grid 1:
code:
[C#]
protectedvoidASPxDashboardViewer1_MasterFilterDefaultValues(objectsender,MasterFilterDefaultValuesWebEventArgse){if(e.ItemComponentName=="gridDashboardItem1"){e.FilterValues=e.AvailableFilterValues.Where(v=>(string)v["CategoryName"]=="Beverages"||(string)v["CategoryName"]=="Condiments");}if(e.ItemComponentName=="cardDashboardItem1")e.FilterValues=e.AvailableFilterValues.Where(v=>(string)v["Country"]=="UK");}
 result:



As a workaround, you need to call the SetMasterFilter client-side method for Cards 1. In this case, filtering will be applied correctly:
code:
[ASPx]
<dx:ASPxDashboardViewer...><ClientSideEventsLoaded="function(s, e) { s.SetMasterFilter('cardDashboardItem1', [['UK']]); }"/></dx:ASPxDashboardViewer>
[C#]
protectedvoidASPxDashboardViewer1_MasterFilterDefaultValues(objectsender,MasterFilterDefaultValuesWebEventArgse){if(e.ItemComponentName=="gridDashboardItem1")e.FilterValues=e.AvailableFilterValues.Where(v=>(string)v["CategoryName"]=="Beverages"||(string)v["CategoryName"]=="Condiments");}


result:

ASP.NET MVC Dashboard - How to save a dashboard state to cookies

$
0
0

The sample illustrates how to save the current ASP.NET MVC Dashboard state (such as master filter or parameter values) to cookies on the client side and restore this state on the server side. The following API is used in this example:
- The ASPxClientDashboard.DashboardStateChanged event is handled to obtain the current dashboard state.
- The ASPxClientUtils.SetCookie client-side method is used to save the dashboard state to cookies.
- The DashboardConfigurator.SetDashboardStateService method is used to apply the dashboard state loaded from the cookies.

How to locate field value cells matching a particular condition

$
0
0

The following example demonstrates how to handle the CustomFieldValueCells event to locate a specific column/row header identified by its column's/row's summary values.
In this example, a predicate is used to locate a column that contains only zero summary values. The column header is obtained by the event parameter's FindCell method, and then removed via the Remove method.

Getting Started - Creating an ASP.NET Dashboard Designer Application (Runtime sample)

ASPxDashboard - How to provide data for ObjectDataSource using the DataLoading event

$
0
0
In this example, the ObjectDataSource.DataSource property specifies the type of a data class. The actual data for this data source is provided by handling the ASPxDashboard.DataLoading event.
Question Comments

Added By: Joe Cassaly at: 10/31/2017 2:48:52 PM    This doesn't work for me. I get the following error.
Dashboard loading settings conflict. Use one of the following approaches to load a dashboard:
-Specify a path to the dashboard XML file using the DashboardXmlPath property.
-Call the OpenDashboard method.
-Provide a dashboard created at design time using the DashboardType property.
-Provide a path to a folder containing dashboards using DashboardStorageFolder.
-Use the SetDashboardStorage to specify a custom dashboard storage.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Exception: Dashboard loading settings conflict. Use one of the following approaches to load a dashboard:
-Specify a path to the dashboard XML file using the DashboardXmlPath property.
-Call the OpenDashboard method.
-Provide a dashboard created at design time using the DashboardType property.
-Provide a path to a folder containing dashboards using DashboardStorageFolder.
-Use the SetDashboardStorage to specify a custom dashboard storage.
Added By: Alex (DevExpress Support) at: 11/1/2017 12:06:46 PM    Hi Joe,

I am afraid I cannot reproduce a similar error when testing the sample project using the latest version (v17.1) of DevExpress assemblies. The sample project uses the DashboardFileStorage object to set the dashboard storage folder to "~/App_Data/Dashboards". If you have modified the sample project source code (e.g., by initializing the ASPxDashboard.DashboardXmlPath property), remove the DashboardFileStorage object initialization from the Page_Load event handler. Should you need further clarification, feel free to ask. We will be happy to help you. 
Viewing all 7205 articles
Browse latest View live


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