The complete description is available in the How to: Use the Entity Framework Code First in XAF topic.
How to: Use the Entity Framework Code First in XAF
How to avoid InvalidOperationException while a TreeList content is exported to XML
This example illustrates how to avoid InvalidOperationException while the TreeList content is exported to XML.
Please refer to the following KB article, which describes this issue in greater detail: http://www.devexpress.com/scid=KA18799
Master-Detail Report Example
This example demonstrates multiple detail bands in a master-detail report.
How to embed the XtraTreeList into a report via scripts
This example shows how to embed the XtraTreeList control into a report via scripts alone. This approach will come in handy especially for XAF users because there is no possibility for them to design their XAF reports in Visual Studio at design time. We plan to overcome this limitation in the future.
See also:
C:\Program Files\Developer Express .NET vX.X\Demos\XtraReports\CS\ReportMainDemo\TreeView\
WinControlContainer
Standard Windows Forms Controls
XRControl - Add a new XRTreeList control to easily show hierarchies in reports
How to create custom total columns in xrPivotGrid at runtime
This example illustrates how to create the xrPivotGrid control with custom total columns at runtime. You can implement calculated columns by using unbound columns. To accomplish this task you need to add an unbound field to the Data area and then handle the PivotGridControl.CustomCellDisplayText event to calculate the summary from the columns that have already been calculated.
How to create a Master-Detail report type using two report layouts at runtime
This example demonstrates how to create Master-Detail report, based on two report layouts (REPX files).
The XtraReport.FindControl method is used to obtain the XRSubreport control instance. The subreport's FilterString property is adjusted via the XRSubreport.BeforePrint event handler.
How to place text inside ToggleSwitch
This example demonstrates how to locate a text inside the ToggleSwitch control instead of being located at the side.
How to enable caching of web reports to allow switching them on the client
The code in this example implements the native caching of web reports displayed by the ASPxDocumentViewer control which allows instantly switching the documents that are cached on the client.
During the ASPxClientComboBox.SelectedIndexChanged event, the HiddenField value is used to identify a report before its initialization that is performed within the Page_Load event handler.
Example Comments
Added By: Chad Eklund at: 6/7/2012 5:15:15 PM
This does not work, refresh is no a property of ReportViewer
viewer.Refresh();
Added By: Alex (DevExpress Support) at: 9/18/2012 5:06:55 AMHi Chad,
The Refresh method is a part of the ReportViewer client-side API: http://documentation.devexpress.com/#XtraReports/DevExpressXtraReportsWebScriptsASPxClientReportViewer_Refreshtopic.
I try to use 2 reports activated by a combobox, but get an error on the hf surroundeed by quotation marks.
I have tried single quotation marks ' , but i won't help.
<dx:ASPxComboBox ID="cboNorskEngelsk" runat="server" ValueType="System.String">
<Items>
<dx:ListEditItem Text="Norsk" Value="1" />
<dx:ListEditItem Text="Engelsk" Value="2" />
</Items>
<ClientSideEvents SelectedIndexChanged="function(s, e) {
document.getElementById("hf").value = s.GetSelectedItem().value;
viewer.Refresh();
}" />
</dx:ASPxComboBox>
Regards
Reidar Thorsvik
How to create headers containing information regarding the current row in a master report
This example illustrates how to prepare headers for Master-Detail reports showing information regarding the current row in a master report. In this scenario, you need to place all necessary header information within a group footer band of the detail report band and set its RepeatEveryPage property to true.
How to detect that the new page is being created and obtain the current page number within the BeforePrint event handler
Note: This example uses undocumented behavior of the XtraReports Suite, so we cannot guarantee that it will work correctly in the XtraReports Suite.
This example illustrates how to detect that a new page is being created and obtain the current page number within the BeforePrint event handler via the PrintingSystem.Document.PageCount property. Note that in this scenario, you should set the DetailBand.KeepTogether property to true.
Another (and more universal) approach to this task is demonstrated at E1952.
See also: AS16487.
Example Comments
Added By: Tobias Lachmann at: 2/8/2013 8:30:54 AM
Ist it possible to get that work in 12.2?
How to update a document displayed by the ASPxDocumentViewer within the ASPxPopupControl
This example illustrates how to update a web report's content on the fly by placing the ASPxDocumentViewer within the ASPxPopupControl and calling the ASPxClientDocumentViewer.Refresh method.
An additional hidden field is provided on the web page to pass parameter values to a report before its document is set forth and published using the ASPxDocumentViewer.
How to implement Drag-Drop functionality between DetailView tabs like in Google Chrome when using the Master-Detail mode in GridControl
This example demonstrates how to implement the Drag-Drop functionality between DetailView tabs like in Google Chrome when using the Master-Detail mode in GridControl.
See also:
How to create a GridView descendant class and register it for design-time use
ASPxGridView - How to set a different Popup EditForm caption when editing and inserting a new row
This example demonstrates how to set a different Popup EditForm caption when editing and inserting a new row.
Syntax highlighting HTML markup using DevExpress CodeParser library and Syntax Highlight tokens
This example demonstrates how to highlight HTML markup content using ISyntaxHighlightService.
A similar approach for highlighting C# and VB code snippets was demonstrated in the following example: Syntax highlighting for C# and VB code using DevExpress CodeParser and Syntax Highlight tokens
In this example, the following modifications of the mentioned approach were made:
- the ITokenCategoryHelper instance was created using the ParserLanguageID.Html parameter
- the "TokenCategory.Html....." and "TokenCategory.Css......" categories were analyzed in the HighlightCategorizedToken method.
GridView - How to implement filtering by null values for the MVCxGridViewColumnType.ComboBox column
This example demonstrates how to implement filtering for a property that contains null values using the GridViewSettings.AutoFilterCellEditorInitialize and GridViewSettings.ProcessColumnAutoFilter properties for this task.
In this example, the "ModelState" column is bound to a nullable enum type.
How to implement XPO data models connected to different databases within a single application
Scenario
This example demonstrates how to create custom XAF modules with custom business objects and logic that would work with separate databases. These modules do not depend on each other and thus can be reused in other applications as a whole.
Steps to implement
0. Create a new XAF solution using one of predefined project templates;
1. Add two XAF modules into this solution using the DevExpress vXX.X XAF Module project template;
2. Add required persistent classes into these modules as shown in the ClassProjectN/PersistentClassN.xx files of this example solution;
3. Add service ModuleInfo classes into these modules as shown in the ClassProjectN/ModuleInfoN.xx files of this example solution;
4. Override the Setup(XafApplication application) methods of your ModuleBase descendants (see the YourModuleName/Module.xx files) as shown in the ClassProjectX/XafModuleN.xx files of this example solution;
5. Build the solution, invoke the Module Designer for the platform-agnostic module (YourSolutionName.Module/Module.xx), and drag the created custom modules from the Toolbox:
See also:
Database: How to show Business Classes from several databases in a XAF application
How to sort a nested ListView at the business objects level, in code
This example demonstrates how to provide hidden and permanent sorting by a property in a nested ListView. Suppose we have Order and OrderItem classes that participate in an aggregated One-To-Many relationship.
We want to sort the collection of OrderItem objects by the ModifiedOn property, but do it in a way that end-users won't be able to see that the grid is sorted. Please see the sources of the Order class for more details on how to accomplish this. With this solution, sorting is implemented on the business objects level. Another variant is to use the approach from the How to sort a ListView in code example. This solution uses a specific ViewController.
Alternatively, you can use the Sorting property of the ListView application model element.
See Also:
How to prevent sorting and grouping by certain columns in a ListView
How to update REPX file for correct working after removing obsolete properties
This example illustrates how to update report saved to the REPX files in order to be able to work with them after removing any obsolete properties of the report's controls. Unfortunately there is no built-in capability to upgrade your reports, so you might need to iterate through the corresponding file and update it accordingly. In this particular scenario report layout is updated to remove obsolete OverlappingOptions property (please refer to the Breaking Changes list posted at http://www.devexpress.com/Support/WhatsNew/DXperience/files/9.3.2.bc.xml#autolist15).
How to bind a Geo Point Map dashboard item to data in code
The following example demonstrates how to bind a Geo Point Map dashboard item to data in code.
How to add sort capability to the web based XtraReport
This example illustrates how to add, and force to work, sorting option buttons to the header area of the web based report. Some key points of this example:
- Sorting is accomplished during the callback, which prevents full page post back (AJAX-orientired behavior).
- Callback raised from the client side by the ASPxClientCallbackPanel.PerformCallback method.
- FieldName of the column, on which the sorting action should take place and the Shift key pressed state is passed to the server as a callback parameter.
- XtraReport.HtmlItemCreated event handled, in order to insert sorting option buttons to the report header via the HtmlEventArgs.ContentCell parameter.
Example Comments
Added By: at: 3/7/2013 12:49:39 PM
When using VS2012 and new versions you have to make this change to fix the JavaScript error you'll receive:
From: Plato (DevExpress Support)2 years ago
To resolve this problem, use the following code for the onclick event handler:
onclick=\"parent.ApplySorting(" + fieldId + ", true);\"
Thanks,
Plato