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

ASPxHint - How to work with dynamically changed elements

$
0
0
This example demonstrates how to show ASPxHint for elements that are changed dynamically. If the ASPxHint has been already registered to work with some page elements and these page elements are changed, it is necessary to call the ASPxClientHint.Update method to reselect target UI elements according to the specified CSS selector.

Document Server - how to use a worksheet as a data source for the Snap report

$
0
0
In this example, a worksheet containing a table with data is loaded in a Workbook instance. The  Table.GetDataSource method returns a data source which is subsequently used to create a report in a SnapControl.
To modify worksheet data before they are exposed as data source fields,  the application utilizes a custom converter which implements the IBindingRangeValueConverter interface. The MyPictureProvider converter finds a picture in a worksheet by its name and returns a picture bitmap instead of a name specified in a worksheet column. 
The custom MyColumnDetector object which implements the IDataSourceColumnTypeDetector interface is used to specify column names and types.
Note that a Snap report template required to visualize the data in the Snap application is created in code at runtime.

How to search and focus nodes in the Tree List editor

$
0
0

Scenario:
By default, XAF provides the following capabilities to filter List Views: Filter List Views. In some cases, these filtering techniques may be inappropriate for a Tree List, since they filter records at the data source level without taking into account their tree structure. They also do not filter node's children, since child nodes are obtained from a persistent object's Children collection independently on a Tree List data source.
To overcome these limitations, it is possible to use the native TreeList filtering in WinForms (see Filtering) and cell templates customization in ASP.NET.

Steps to implement:
1. Create a ViewController for your Tree List ListView (WinFilterTreeListViewController and WebFilterTreeListViewController in this example).
2. Add actions allowing your users to apply filters to this ListView.
3. Handle the Execute event of these actions to customize the underlying TreeList control according to the required result.

In this example, the following functions are implemented:


WinForms:

 - Finding a node through the TreeList.FindNode method and focusing it. To test this function, enter a value in the FocusNode action and click the Focus button.
 - Applying a full text filter to the TreeList control through the TreeList.ApplyFindFilter method. To test this function, enter a value in the FindNode action and click the Smart Search button.
The Search button displayed near the Focus and Smart Search buttons is provided by the built-in FilterController and is not customized. Use it to compare the functionality implemented by the example with a simple data source-level filtering.




It is also possible to use a native TreeList Find Panel instead of a ParametrizedAction for the full text filtering. Note that nodes will be filtered only if you set the TreeList.OptionsBehavior.EnableFiltering property to true. Otherwise, they will be only highlighted.
To change the way filtering is applied to the tree hierarchy, use the TreeList.OptionsFilter.FilterMode property.
If it is necessary to apply a filter only to certain columns, use the TreeList.ActiveFilterCriteria property instead of the TreeList.ApplyFindFilter method (see the commented code in the WinFilterTreeListViewController.findNodeAction_Execute event handler).
Note that since XAF loads child nodes dynamically when their parent is expanded, filters are not applied to collapsed children. That is why nodes are expanded before filtering in this example.


ASP.NET:
Since the ASP.NET TreeList control (ASPxTreeList) does not provide native filtering capabilities, this example demonstrates how to highlight nodes containing the specified text. This functionality is implemented through the ASPxTreeList.HtmlDataCellPrepared event, very similar to what is done in the non-XAF ASPxTreeList - How to create an external filter with the ASPxTextBox and highlighting search text example.  In the event handler, cell controls provided by XAF property editors are replaced with labels containing a highlighted text. Note that to highlight a text, a custom style is used. It is declared in the Default.aspx page through the <style> tag. If you do not add this style to your application, nodes will not be highlighted.


Question Comments

Added By: John Whattam 1 at: 6/17/2013 6:50:46 PM    

Where's the recursion?

Added By: Andrew Bingham 2 at: 11/3/2013 10:23:19 PM    

Goes into an inifinite loop

Web Dashboard - How to obtain underlying data for the specified dashboard item

$
0
0

The following example demonstrates how to get underlying data for the specified dashboard item using the ASPxClientDashboard.RequestUnderlyingData method. This method accepts the component name of the dashboard item and specific parameters used to request data.

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

$
0
0

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

In this example, the ASPxClientDashboardViewer.ItemClick event is handled to obtain underlying data and invoke the dxPopup widget with the child dxDataGrid.

In the event handler, the RequestUnderlyingData method is called to obtain records from the dashboard's data source. The dxDataGrid is used to display these records.

Question Comments

Added By: Angelo G at: 5/31/2016 9:18:34 AM    Hello,

I would like to show dashboard item's underlying data using mouse right click event or double click, instead of left click event. Please let me know how to do it.

Thanks. Added By: John (DevExpress Support) at: 5/31/2016 10:50:59 PM    Hello Angelo,
You have already asked this question in a separate topic: How to obtain a dashboard item's underlying data in the Web Viewer using double click event or right click event. Refer to it for further correspondence. Added By: Rob Giesbrecht at: 1/23/2017 4:21:59 PM    This is great, but... this code only works with pivot & grid widgets (and cards, curiously if only drill down isn't enabled). When I hit the:

 args.RequestUnderlyingData(function (data) {

line when using with any other sort of widget (say a gauge for example), I receive a "An error has occurred on an attempt to get underlying data for the gaugeDashboardItem1 item...Nullable object must have a value".

Any suggestions?Added By: Sergi (DevExpress Support) at: 1/24/2017 4:46:58 AM    

Hello,

I've created a separate ticket on your behalf (T475428: Web Dashboard Viewer - RequestUnderlyingData method causes error). It has been placed in our processing queue and will be answered shortly.

WinForms Viewer - 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.

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

$
0
0

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

In this example, the ASPxClientDashboard.ItemClick event is handled to obtain underlying data and invoke the dxPopup widget with the child dxDataGrid. In the event handler, the RequestUnderlyingData method is called to obtain records from the dashboard's data source. The dxDataGrid is used to display these records.

How to load an excel file to the server using ASPxUploadControl and display its data in ASPxGridView

$
0
0

This example shows how to load an excel file from your computer to the server using ASPxUploadControl and then display its data in ASPxGridView.
To do this, you first need to place the ASPxGridView and ASPxUploadControl controls on a page and, secondly, handle the ASPxGridView.Init event and both the server-side and the client-side ASPxUploadControl.FileUploadComplete events.
After uploading the excel file from your computer, save it in the "~/XlsTables/" directory using the ASPxUploadControl.FileUploadControl event handler on the server-side. You may choose any filename and then save it in the Session["FileName"] object to use later.
In the ASPxGridView.Init event handler you need to check the value of the Session["FileName"] object. If it's null, do nothing. Otherwise create a new DataTable and DataTableExporter objects.

See also:
GridView - How to upload an Excel file via UploadControl and display its data in a grid

Note:
The DevExpress.Docs assembly is used in this example. So, the Document Server subscription license is required to implement the demonstrated approach.

Question Comments

Added By: John Daren Dizon 1 at: 5/11/2015 8:43:46 PM    

So how can I save the data uploaded in the grid into a database?

Added By: Sergi (DevExpress Support) at: 5/12/2015 12:25:35 AM    

Hello,

To process your recent post more efficiently, I created a separate ticket on your behalf: T240435: ASPxGridView How to save data from Excel to a database. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.

Added By: wael ramadan at: 11/28/2015 5:01:26 AM    

I used this code. Version=14.1.6.0  visual studio 2012 version.,   But it shows a red line under(workbook)      Workbook book = new Workbook();

Added By: Vladimir (DevExpress Support) at: 11/29/2015 11:00:46 PM    

Hello,

To process your recent post more efficiently, I created a separate ticket on your behalf: T318205: How to load an excel file to the server using ASPxUploadControl and display its data in ASPxGridView. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.


ASPxGridView - How to use the client-side FocusedCellChanging event and prevent editing certain cells

$
0
0
Starting from version 17.1 we have introduced a new client-side FocusedCellChanging event. This event allows you to skip focusing and editing a cell.
This example demonstrates different ways to skip or prevent editing certain cells.

Web Dashboard - How to remove Items or Groups from the Toolbox

$
0
0
This example demonstrates how to remove certain items or groups from the Web Dashboard control's Toolbox using extensions - independent JavaScript modules/classes that provide certain functionality to the Web Dashboard control. In this example, the Grid and Pivot dashboard items are removed as well as the Maps toolbox group.

How to create a custom converter to convert the CriteriaOperator to the System.String type

$
0
0

Sometimes the default way of converting CriteriaOperator into System.String is not acceptable. This example demonstrates how to create your own converter by implementing the ICriteriaVisitor and IClientCriteriaVisitor interfaces.

See also: How to delete all criteria corresponding to a particular field from CriteriaOperator

Question Comments

Added By: Ujjawal Kaushik 1 at: 4/24/2017 3:48:02 AM    Hi ,when i am using the below code i am getting error in the below line

ICriteriaVisitor<string>, IClientCriteriaVisitor<string>

The non-generic type DevExpress.Data.Filtering.ICriteriaVisitor Can not be used with type argument s.

Can you explain what's the problem with this Added By: Uriah (DevExpress Support) at: 4/24/2017 5:34:30 AM    

Hello Ujjawal,

I've created a separate ticket on your behalf (T507368: The non-generic type DevExpress.Data.Filtering.ICriteriaVisitor Can not be used with type arguments). It has been placed in our processing queue and will be answered shortly.

dxDropDownBox - How to filter data of a nested widget when a user types text into the editor when the jQuery approach is used

$
0
0

In this example, dxDropDownBox enables end-users to filter list items dynamically based on the text typed into the editor's input box on the client side.

dxDropDownBox - How to filter data of a nested widget when a user types text into the editor when the KnockoutJS approach is used

$
0
0
In this example, dxDropDownBox enables end-users to filter list items dynamically based on the text typed into the editor's input box on the client side.

Document Server - Use non-visual components to create a Snap report, bind it to worksheet data and print to PDF

$
0
0
This example uses the Snap Document Server library to create a report, bind it to data and export to PDF. The data are obtained from a worksheet file in .XLSX format using the data binding feature of the Spreadsheet Document Server library.
The report template is created in code using the CreateSnText and CreateSnImage methods.
Data source is created from a worksheet table with the Table.GetDataSource method. Floating pictures in a worksheet are processed with a custom XPictureProvider converter to provide Bitmap data for the data source Photo field. The converter implements the IBindingRangeValueConverter interface. The converter is specified using the RangeDataSourceOptions.CellValueConverter property of the object passed to the Table.GetDataSource method as a parameter.


dxDropDownBox - How to filter data of a nested widget when a user types text into the editor when the AngularJS approach is used


How to create custom shapes with custom connection points for DiagramDesignerControl

$
0
0

The Diagram control supports a special language for defining shapes. The main element that contains shape description is ShapeTemplate. This element describes a shape contour and may contain several segments:
- Start. Specifies the start point
- Line. Defines a line with start and end points
- Arc. Defines an arc with start and end points

To specify connection points, use the ShapeTemplate.ConnectionPoints property.
To register custom shapes, create a stencil with the DiagramStencil.Create method and pass it to the DiagramToolboxRegistrator.RegisterStencil method.

Question Comments

Added By: Greyce at: 3/31/2017 7:18:09 AM    How can I create straight line and curve line customized?


Regards,
Greyce
Added By: Alexander Ch (DevExpress Support) at: 4/3/2017 12:33:05 AM    Hi Greyce,

I see that you've asked a similar question in the T497203 - How to draw straight and curved lines in DiagramControl thread. Feel free to leave a comment there if you need additional information about the suggested approach.

Thanks,
AlexAdded By: Vidas Drevinskas 1 at: 5/29/2017 7:39:24 AM    Is there any documentation on how to use Start, Line, Arc elements to draw figure, How to use CreateSize, CreatePoint functions? is there any others?

I want to create shape with some part of it to be fixed to height and ignore widht changes:
etc. Sample shape here arcs are fixed to height of shape and do not changes when widht of shape is changed.



dxDropDownBox - How to filter data of a nested widget when a user types text into the editor when the Angular approach is used

$
0
0

How to insert PRISM regions into DockLayoutManager panels

$
0
0

This example demonstrates how define a region at the LayoutPanel level and insert a view from another assembly into it. To create an instance of the PRISM adapter for a LayoutPanel, use the AdapterFactory.Make method:

[C#]
mappings.RegisterMapping(typeof(LayoutPanel),AdapterFactory.Make<RegionAdapterBase<LayoutPanel>>(factory));

How to group GridControl by multiple values [the Multi Value Grouping demo version 16.2 and lower]

$
0
0
This example contains the corresponding demo from our Demo Center version 16.2 and lower. It emulates the MS Outlook grouping feature, where tasks can belong to multiple categories.

How to: customize the dialog's footer buttons

$
0
0
This example demonstrates how to customize the dialog's footer buttons.
Viewing all 7205 articles
Browse latest View live


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