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

How to print or export a report from code in a Silverlight Out-Of-Browser application with elevated permissions without previewing it.


ASPxCheckBoxList - How to emulate ASPxRadioButtonList that allows users to unselect items

$
0
0

Unfortunately, ASPxRadioButtonList does not allow handling the click event for a separate item. Thus, it is better to use ASPxCheckBoxList to allow users to unselect items. Handle the SelectedIndexChanged event to emulate the ASPxRadioButtonList behavior in the following way:


[JScript]
function OnCBLSelectedIndexChanged(s, e){ s.UnselectAll();if(e.isSelected) s.SetSelectedIndex(e.index);else s.UnselectIndices(e.index);}

Then, customize the control's images using the SpriteProperties property and specifying the corresponding theme name in the prefix of a class:

[ASPx]
<dx:ASPxCheckBoxList...Theme="DevEx"> ...<CheckedImageSpriteProperties-CssClass="dxEditors_edtRadioButtonChecked_DevEx"></CheckedImage><UncheckedImageSpriteProperties-CssClass="dxEditors_edtRadioButtonUnchecked_DevEx"></UncheckedImage><Items> ...</Items></dx:ASPxCheckBoxList>

See Also:
CheckBoxList - How to emulate RadioButtonList that allows users to unselect items

CheckBoxList - How to emulate RadioButtonList that allows users to unselect items

$
0
0

Unfortunately, RadioButtonList does not allow handling the click event for a separate item. Thus, it is better to use CheckBoxList to allow users to unselect items. Handle the SelectedIndexChanged event to emulate the RadioButtonList behavior in the following way:


[JScript]
function OnCBLSelectedIndexChanged(s, e){ s.UnselectAll();if(e.isSelected) s.SetSelectedIndex(e.index);else s.UnselectIndices(e.index);}

Then, customize the control's images using the SpriteProperties property and specifying the corresponding theme name in the prefix of a CSS class:


[C#]
settings.Properties.UncheckedImage.SpriteProperties.CssClass="dxEditors_edtRadioButtonUnchecked_DevEx";settings.Properties.CheckedImage.SpriteProperties.CssClass="dxEditors_edtRadioButtonChecked_DevEx";

See Also:
ASPxCheckBoxList - How to emulate ASPxRadioButtonList that allows users to unselect items

How to create a Liquid Bar chart

$
0
0

The following example demonstrates how to create a 3D Full-Stacked Bar chart with a "liquid" effect.

For this, two series are added to the chart - one series contains visible data points and another semi-transparent series to fill the top part of bars.

How to add the ASPxValidationSummary control to ASPxGridView's EditForm

$
0
0

This example demonstrates how to add the ASPxValidationSummary control to ASPxGridView's EditForm:

- Specify a custom EditFormTemplate;

- Replace auto-generated EditForm editors via the ASPxGridViewTemplateReplacement (ReplacementType=EditFormEditors);

- Add the ASPxValidationSummary control to collect EditForm Template validation errors;

- Perform the client-side EditForm Template validation via the client-side ASPxClientEdit.ValidateEditorsInContainer method.

How To: Implement a custom security operation that can be permitted at the type level

$
0
0

In the XAF Security System, the following operations can be permitted for a specific type by default: Read, Write, Create, Delete and Navigate. In this topic, an implementation of the additional Export operation is shown. The customization of the ExportController which should consider whether or not the Export operation is allowed for the currently displayed object type is also demonstrated.

The complete description is available in the online documentation.

Example Comments

Added By: Konstantin B (DevExpress) at: 1/29/2013 5:16:25 AM    

The help topic will be published online after the 12.2.6 version is released.

Create a Mobile App in Visual Studio

How to bind TextBox to Model property in MVC 3 using the Razor engine


Correct and incorrect examples of using height=100% in HTML

$
0
0

The main problem with applying height - 100% to HTML elements is that if you wish to set a relative height to an HTML element, all its parent HTML element's 'height' style must be initialized. If there is any parent with a non-initialized height, it collapses all its children. This example demonstrates this behavior.

See also:
Relative height (100%) in DevExpress ASP.NET controls

How to get joined tables from the LinqServerModeDataSource using a custom LINQ query

$
0
0

This example demonstrates how to get joined tables from the LinqServerModeDataSource by using a custom LINQ query.
In the example the server-side LinqServerModeDataSource.Selecting event was handled and the QueryableSource property was used to specify the required LINQ query expression.


OBSOLETE - How to skip readonly editors when moving through editors, using the Tab key

$
0
0

===============================================================
This example is obsolete with version 13.2. Refer to the Usability.Win - Do not tab stop on disabled/readonly editors and columns ticket for more details.
===============================================================

Example Comments

Added By: mukhlim fazal at: 3/23/2013 8:55:54 AM    

how about moving through editors using enter?

Added By: Alexey Guido at: 4/23/2013 12:36:15 AM    

> - support readonly columns in the Grid's "Inplace Edit Mode"
Example E1508 doesn’t work for grids.
How to make it work for grids (including add columns, remove columns, change AllowEdit for columns)?
Is it possible to include solution in default XAF distributive?

How to add the possibility to download an image from the ASPxImageGallery

How to dynamically load a control that supports callbacks into another control on callback

$
0
0

This sample demonstrates how to dynamically load a control that supports callbacks into another control on callback.
The sample is created using the ASPxDataView and ASPxCallbackPanel controls.

Example Comments

Added By: yerzu at: 7/6/2013 9:15:54 PM    

Hi,

something is wrong with this dxsample file, please check it!

Added By: yerzu at: 7/6/2013 9:30:32 PM    

Ok I run this, but its a quite simply example.... I have a problem with load from callback a CustomScheduler - first LoadControl (inside callback) hangs! Please help with that!

How to add a filter TextBox to the XtraPivotGrid Column Chooser

$
0
0

This example illustrates how to add a field filter text box to the PivotGridControl's Column Chooser window (Customization Form). To achieve this goal, handle the ShowCustomizationForm event. In this event handler, you can get a displayed customization form via the PivotGridControl.CustomizationForm property. Then add a TexbBox control onto this form and handle the TextBox.EditValueChangedevent to hide PivotGridFields which do not meet the entered text via the field.Options.ShowInCustomizationForm property.

How to implement dependent views in a DashboardView (filter based on selection)

$
0
0

This example illustrates how to filter a ListView displayed in a DashboardView based on another ListView's selection.

Scenario
When a DashboardView contains several list views, it is often required to make them dependent, e.g. display items of one ListView based on items or selection of another ListView. This example shows how to do this.

Steps to implement
1. Add a new ViewController to your platform-agnostic module.
2. In the OnActivated method retrieve the necessary DashboardViewItems via the FindItem method. After that subscribe to the ControlCreated event of the DashboardViewItem whose ListView will be used for filtering (hereinafter referred to as SourceView).
3. In the ControlCreated event handler retrieve the SourceView via the DashboardViewItem.InnerView property and subscribe to its SelectionChanged event.
4. In the SelectionChanged event handler retrieve the that will be filtered (hereinafter referred to as TargetView) in the same manner as in the previous step.
5. To retrieve an object by which filtering will be performed, use the ListView.CurrentObject property. This object must be loaded from SourceView ObjectSpace to TargetView ObjectSpace via the GetObject method.
6. Now you can simply filter the TargetView by adding CriteriaOperator to the TargetView.CollectionSource.Criteria dictionary. In my example, I created a simple InOperator to filter the Position column via objects from SourceView.

Important notes:
The provided algorithm is platform-agnostic. It will work without any additional code in WinForms applications, but in ASP.NET the TargetView will not be refreshed immediately after changing the SourceView's selection. It is required to post changes made on the server side to a client to show them in the browser. That is why I have implemented the DashboardViewRefreshController that will refresh DashboardView when selection in the SourceView is changed. Handle the WebWindow.CurrentRequestWindow.PagePreRender event. In this event handler, find the ASPxGridView, modify its ClientSide SelectionChanged event, and modify the script using the CallbackManager as shown in the DashboardRefreshController.cs file.


LookUpEdit - Processing New Values

$
0
0

This example shows how to manually initialize a new value and add it to a data source.

Update:

Starting with version 13.1 of DevExpress controls, you can use the DevExpress MVVM Framework to accomplish this task. It is necessary to create a command in the view model (for instance, the ShowProductFormCommand command) and bind it with the LookUpEditBase.ProcessNewValue event via the trigger. This would allow you to display the dialog (UserControl1.xaml file) for editing new source items in the LookUpEdit control when this even is raised. Then, you can implement custom logic in the OnShowProductFormCommandExecute (ProductList.cs file) method to process values in this dialog.


Please review our blogs to find additional information about DevExpress MVVM Framework:

Getting Started with DevExpress MVVM Framework. Commands and View Models.
DevExpress MVVM Framework. Introduction to Services, DXMessageBoxService and DialogService.
DevExpress MVVM Framework. Interaction of ViewModels. IDocumentManagerService.

Example Comments

Added By: Sorin Sandu at: 7/10/2012 11:47:32 AM    

Hi
Is it possible to close the popup before showing the dialog ?

Added By: Raumnz at: 9/25/2013 1:29:32 PM    

hi
once entered the new value on the product name, I tab . should the lost focus open the new tab?

thanks.
PD. I have to click outside the control for the pop up to show.

ASPxGridView - How to sort header filter items in the descending order

$
0
0

This example demonstrates how to change the header filter items order.

The idea is to handle the ASPxGridView.HeaderFilterFillItems event and use the e.Values property that has the OrderByDescending method allowing you to change the order of items in the collection.
The order of items in the "CategoryName" column was changed to demonstrate this approach in action.

How to print DevExpress ASP.NET controls via XtraReports

$
0
0

This example illustrates how to print and/or export DevExpress ASP.NET controls by embedding them into an XtraReport.

In this example an ASPxGridView and WebChartControl are added to a report by using DevExpress.XtraReports.UI.PrintableComponentContainer objects.

Example Comments

Added By: Dhaval.Shah at: 11/21/2013 3:58:11 AM    

Hi all,
When I try to open this solution with VS2010 (DevEx 13.1.7), it says project is incompatible with current version of Visual Studio.
Can you please help?
Thanks

How to create a drill-through report in WPF

How to: Create a custom chart data source

$
0
0

Sometimes it is necessary to change cell values using custom summary calculation rules. When the custom summary depends on values in other cells, the only possible way to perform a custom calculation is to do it within the PivotGridControl.CustomCellDisplayText or PivotGridControl.CustomCelllValue event handlers. However, customized values are not available in the chart data source. This example demonstrates how to create your own chart data source that takes into account values provided within the CustomCellValue event.

Viewing all 7205 articles
Browse latest View live


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