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

How to show a hint panel in an XAF Windows Forms application

$
0
0

Our FeatureCenter and AuthorizationDemo demos, which are installed with our product, contain controllers for showing hints for a list view in Web and Win applications. Since there is a need to show hints in both platforms, the structure of these controllers is complicated and may be difficult to understand. I've created a simple Windows forms example, which shows the hint panel (DevExpress.Utils.Frames.NotePanelEx), to make the concept of showing it clearer. The panel is placed on a form in the WindowHintController. This controller accesses the control to which the view is placed and adds a panel to it. So, the panel is placed near the view. Another controller - ViewHintController - demonstrates how to change the text of the added panel.
We also have a more flexible example of now to accomplish this task: How to: Create Information Panels. It is appropriate for both Win and Web and provides better capabilities to manage the location of the additional panel, but requires templates customization. Use that example if the functionality of this example is insufficient for you.

See Also:
Frame.Template Property
Templates

Question Comments

Added By: Saif Khan at: 6/28/2014 8:19:21 AM    

The link to "How to: Create Information Panels: is broken.


How to provide inplace editors for columns headers?

$
0
0


This example demonstrates how to manually draw an editor in column headers and activate them on mouse click.

Question Comments

Added By: Yuan Kwei Huang at: 6/29/2014 10:24:36 AM    

Sorry, I read your sample code, but still have not idea how to use it.
How do I combine my grid control/view with this sample code?

How to create a Range Area chart

$
0
0

The following example demonstrates how to create a Range Area chart at runtime.

Note that this series view type is associated with the XY-Diagram type, and you should cast your diagram object to this type, in order to access its specific options.

How to enable highlighting focused row when cells in the grid are merged

$
0
0

When merging is used, the grid suppresses the FocusedRow appearance. A workaround is to handle the GridView.RowCellStyle event and provide the appearance explicitly.

[OBSOLETE, version v13.2 only] ASPxGridView - How to disable editing for rows that match some condition in Batch Edit Mode

$
0
0

This example demonstrates how to disable editing for rows whose discontinued value is true. In this example, ASPxGridView is created with ASPxGridView.SettingsEditing.Mode = "Batch" and the ASPxGridView.HtmlRowCreated event is handled. For each cell in a row whose discontinued value is true, an attribute that cancels a click is added. Please note that in this case the row still can be edited by pressing the enter or tab key in the previous row. This example is for the 13.2 version and older. For the newer versions, see the ASPxGridView - Batch Editing - How to cancel editing or disable the editor conditionally example

How to create a Full Stacked Line chart

$
0
0

The following example demonstrates how to create a Full-Stacked Line chart at runtime.

Note that this series view type is associated with the XY-Diagram type, and you should cast your diagram object to this type, in order to access its specific options.

How to use a ComboBoxEdit whose choices are different for each cell in the grid

$
0
0

There are two ways to accomplish this task: via filter criteria and by using a multibinding approach. Let me explain theses approaches in detail.


1) Filter criteria

The main idea is to dynamically construct a filter by using the selected value of the first column in the grid. So, items in the ComboBox editor will be filtered automatically according to the filter's value. In this case, it is necessary to create a converter (which implements the IValueConverter interface) in the code-behind file.


2) Multibinding approach.
You can also resolve this problem by using the multibinding approach. Specify multiple bindings in a MultiBinding object and create a converter (which implements the IMultiValueConverter interface) to produce a final value for the binding target property based on values of those bindings.

Question Comments

Added By: XempleX at: 4/5/2013 1:10:41 AM    

The problem with this solution is that the ItemsSource is used by all the rows in the grid. This means that, if you've already selected a colour for "Make1", then while you're selecting a colour for "Make2", the colours in the "Make1" rows disappear! In fact, in the example below, they never reappear because the HiddenEditor event hasn't been handled. So this solution is only useful when you only have a single "Make" in the grid (which means that it isn't really useful at all).

Added By: Elliot (DevExpress Support) at: 4/16/2014 12:54:00 AM    

Please accept my sincere apologies for the delayed response. I re-created this code example in November, 2013. Currently, this code example works correctly for this situation. You can download the new version of this code example from our website and check it. If you experience any further difficulties, do not hesitate to contact us again. We are here to help you.

How to filter grid columns using separate CheckedListBoxControls

$
0
0
This code example illustrates how to create separate CheckedListBoxControls filled with unique column values and filter a grid via checking items. To get column unique values, the DataController.GetUniqueColumnValues method is used. Please note that the GridView.DataController property is hidden from IntelliSense, and you need to type it manually.

How to create a PropertyGridControl descendant class supporting PaintValue in UITypeEditor

$
0
0

 

This example demonstrates how to create PropertyGridControl and VGridPainter descendant classes. To support PaintValue in UITypeEditor, it's necessary to add a method to get UITypeEditor in your PropertyGridControl class and override the DrawRowValueCellCore method in the VGridControl class.

How to configure dxExporter

ASPxGridView - Batch Edit - How to calculate values on the fly

$
0
0

This example demonstrates how to create an unbound column that calculates the sum of other columns and changes its values on the fly when end-user changes any grid values using Batch edit mode. To implement the required task, perform the following steps:

1. Create an unbound column in the same manner as described in the ASPxGridView.CustomUnboundColumnData Event help article:

[ASPx]
<dx:GridViewDataTextColumnFieldName="Sum"UnboundType="Decimal"ReadOnly="true"></dx:GridViewDataTextColumn>
[C#]
protectedvoidGrid_CustomUnboundColumnData(objectsender,ASPxGridViewColumnDataEventArgse){if(e.Column.FieldName=="Sum"){decimalprice=Convert.ToDecimal(e.GetListSourceFieldValue("Price"));intquantity=Convert.ToInt32(e.GetListSourceFieldValue("Quantity")); e.Value=price*quantity;}}

2. Handle the client-side ASPxClientGridView.BatchEditStartEditing event to save the currently edited column name as a global JavaScript variable:

[JScript]
var currentColumnName;function OnBatchEditStartEditing(s, e){ currentColumnName = e.focusedColumn.fieldName;}

 3. Handle the ASPxClientGridView.BatchEditEndEditing event to re-calculate the values based on the new changes and set it to the unbound column using the ASPxClientGridViewBatchEditApi.SetCellValue method:

[JScript]
function OnBatchEditEndEditing(s, e){ window.setTimeout(function(){var price = s.batchEditApi.GetCellValue(e.visibleIndex, "Price");var quantity = s.batchEditApi.GetCellValue(e.visibleIndex, "Quantity"); s.batchEditApi.SetCellValue(e.visibleIndex, "Sum", price * quantity);}, 10);}

 
See Also:

ASPxGridView - How to update total summaries on the client side in Batch Edit mode
ASPxGridView - Batch Edit - How to calculate unbound column and total summary values on the fly 

ASPxMenu - How to show a sub menu with a full page width

$
0
0

While our team is still working on this functionality in the context of the ASPxMenu - Provide an option to show a sub menu with a full page width  thread, you can accomplish this task in the following manner: 


1) Assign the following CSS class to the SubMenuStyle.CssClass property: 
[CSS]
.subMenu{width:100%;box-sizing:border-box; 

2) Handle the client-side PopUp event to adjust a sub menu:

[JScript]
function OnPopup(menu, e){var el = menu.GetMenuElement(e.item.indexPath); el.style.left = 0; el.style.right = 0; el.style.width = '100%';} 

The example below demonstrates this approach in action.

GridView - Batch Edit - How to calculate unbound column and total summary values on the fly

ASPxGridView - Batch Edit - How to calculate unbound column and total summary values on the fly

How to deploy a WPF Report Designer on the client

$
0
0

This example illustrates how you can deploy a WPF Report Designer on the client (without a reporting server).


To deploy the WPF Report Designer locally, do the following.

1. Substitute the default client for the Report Designer with a custom one.

1.1. Create a custom client (in this sample, see LocalReportDesignerClient) that implements the IReportDesignerServiceClient interface. All methods of this interface are delegated from ReportService that is defined as a field or property in this client.

1.2. The client can refer to a ReportService type object, but it does not implement saving/loading of a report layout. For this reason, add an extension class that implements IDesignerReportStore interface (in this sample, see LocalDesignerReportStore class showing a simplified implementation of the LoadLayout and SaveLayout methods of the IDesignerReportStore interface).
 1.3. In this sample, the Abort and CloseAsync methods in LocalReportDesignerClient are intentionally left empty, because they are not required.

1.4. Since the ReportDesignerViewModel exposes not the client, but its factory, you need to create this factory as well (in this sample, LocalReportDesignerClientFactory) and assign it to the Designer’s view model (in this sample, see MainWindow.xaml.cs).

2. For the ReportDesignerViewModel, specify a report's name and namespace, as well as a fake ServiceUri.


See also: How to use a WPF Report Designer in a client-server mode.

Question Comments

Added By: Xavier de LURION at: 9/19/2012 7:21:57 AM    

In your exemple, you use a Report designed in Visual Studio, but how do you do to load it from database ?

Added By: Ramesh Supekar at: 6/6/2014 2:58:34 AM    

For the example here in downloads

In ribbon control Watermark button click  gives null reference error , Please guide how to fix this .

Added By: Dani Rotzetter at: 7/1/2014 7:59:16 AM    

Hello, do you intend to, some time in the future, provide methods to launch the designer in a "real" client mode, without the need to create a "fake" server service that must be run on localhost?
Kindest regards

Added By: Igor D (DevExpress) at: 7/1/2014 10:09:25 AM    

Hi Ramesh Supekar,

Please see the following ticket: http://isc.devexpress.com/Thread/WorkplaceDetails/T115655

Added By: Igor D (DevExpress) at: 7/1/2014 10:12:37 AM    

Hi Dani Rotzetter,
 
Currently, we do not have immediate plans to implement a full-featured WPF report designer.


How to add a WebChartControl to the ASPxCallbackPanel on its callback

$
0
0

This example demonstrates how you can use the WebChartControl and ASPxCallbackPanel together.

Question Comments

Added By: Raaja Raajan Angathevar Veluchamy at: 6/28/2013 3:39:32 PM    

does not work.

Added By: Ray [SQL Sentry] at: 7/31/2013 10:56:19 AM    

This does not seem like a complete example.

Added By: Andre Murta X at: 8/17/2013 4:39:45 AM    

It does not work. Even when I found the complete example at "http://documentation.devexpress.com/#AspNet/CustomDocument7555", when I try to compile it under Visual Web Developer 2010, I have the error message "object does not offer support to the PerformCallBack method or property".

Added By: Ricidleiv Tondatto at: 7/1/2014 11:54:43 AM    

How to make this using version 11.1? I'm getting a crashed image.

How to dynamically add a WebChartControl to a web page

$
0
0

This example demonstrates how a chart can be generated and shown in a web page with an ASPxButton click.

Note that prior to accessing elements and properties of a dynamically created WebChartControl, it should be added to the Page.Form.Controls collection.

See also: How to add a WebChartControl to the ASPxCallbackPanel on its callback.

Question Comments

Added By: Ricidleiv Tondatto at: 7/1/2014 11:59:45 AM    

I'm not able to do that using version 11.1. The chart is a crashed image. What's wrong?

GridView - Batch Edit - How to calculate values on the fly

$
0
0
This example demonstrates how to create an unbound column that calculates the sum of other columns and changes its values on the fly when end-user changes any grid values using Batch edit mode.
To implement the required task, perform the following steps:

1. Create an unbound column in the same manner as described in the Unbound Columns help article:
[C#]
settings.Columns.Add(column=>{column.UnboundType=DevExpress.Data.UnboundColumnType.Decimal;column.FieldName="Sum";column.ReadOnly=true;});settings.CustomUnboundColumnData=(sender,e)=>{if(e.Column.FieldName=="Sum"){decimalprice=Convert.ToDecimal(e.GetListSourceFieldValue("Price"));intquantity=Convert.ToInt32(e.GetListSourceFieldValue("Quantity"));e.Value=price*quantity;}};

2. Handle the client-side ASPxClientGridView.BatchEditStartEditing event to save the currently edited column name as a global JavaScript variable:

[JScript]var currentColumnName;
function OnBatchEditStartEditing(s, e) {
    currentColumnName = e.focusedColumn.fieldName;           
}

 3. Handle the ASPxClientGridView.BatchEditEndEditing event to re-calculate the values based on the new changes and set it to the unbound column using the ASPxClientGridViewBatchEditApi.SetCellValue method:

[JScript]function OnBatchEditEndEditing(s, e) {
    window.setTimeout(function () {
        var price = s.batchEditApi.GetCellValue(e.visibleIndex, "Price");
        var quantity = s.batchEditApi.GetCellValue(e.visibleIndex, "Quantity");
        s.batchEditApi.SetCellValue(e.visibleIndex, "Sum", price * quantity);
    }, 10);
}

 
See Also:
GridView - Batch Edit - How to calculate unbound column and total summary values on the fly

ASP.NET Web Forms Example:
ASPxGridView - Batch Edit - How to calculate values on the fly

How to change the DocumentPanel header background

$
0
0

This example shows how to change the DocumentPanel header background.

Question Comments

Added By: bo sorrow at: 7/2/2014 7:44:31 AM    

dx:ThemeManager.ThemeName ??

Added By: Andrew K (DevExpress Support) at: 7/2/2014 11:01:44 AM    Hi,

I don't understand your comment. Please describe the problem you faced in greater detail.

Thanks,
Andrew

How to use automatic date-time scale modes of an axis

$
0
0

This example demonstrates how to use date-time scale modes of an axis (both manual and automatic).

Question Comments

Added By: Phil Kenderdine at: 7/2/2014 4:58:33 PM    

How can I run this example. I thought there was an option to run on-line. I have Example Runner. I am unable to compile since I have version 11.1 not 13.2 in the example.

Added By: John (DevExpress Support) at: 7/2/2014 8:28:18 PM    This example cannot be run online since it is a WinForms project. You can download an example different versions. Choose the required version from the combobox on this page (9.2.4 - 11.2.14).
Viewing all 7205 articles
Browse latest View live


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