In some situation it can be helpful to replace default items with custom ones. E.g. if you have too many items they can be convenient for grouping them based upon certain criteria and displaying group items in a filter popup. It is possible to handle the CustomFilterPopupItems event to remove default items and add group items instead. To apply a filter based upon the selected by end-users, handle the FieldFilterChanging event.
How to replace default filter items with custom ones
How to bind ASPxScheduler to ObjectDataSource
In this example, the ObjectDataSource control is used to bind the ASPxScheduler control to middle-layer business objects. Further, you can implement your own custom CRUD-operations (Create, Read, Update, Delete – a common abbreviation for data operations) using an arbitrary data provider.
To make the project simple and easy-to-use, data is written into a session.
See Also:
How to bind ASPxScheduler to ObjectDataSource
How to bind ASPxScheduler to MS SQL Server database
How to bind ASPxScheduler to XPO via the Unit of Work
How to bind ASPxScheduler to SyBase ASE 15 database
CustomEditor : How to create a custom ButtonEdit that allows displaying RTF/HTML readonly content
This example demonstrates how to create an editor that allows displaying rich content and buttons at the same time.
In this example we have created a RepositoryItemButtonEdit descendant with an additional RichEdit property. The RichEdit property is a RepositoryItemRichTextEdit object. It is used to draw the editor content in a required document format.
In addition, the RepositoryItemRichTextEdit object is used to calculate the row height when this editor is used as an inplace editor in GridControl or TreeList. To enable the auto height calculation feature, the editor should implement the IAutoHeightControl interface, and its ViewInfo should implement the IHeightAdaptable interface.
How to replace the default Filter Popup with a custom one made with ASPxGridView control
This example demonstrates how to replace the default Filter Popup with a custom one made with the ASPxGridView control. This solution demonstrates only a basic approach, and it is possible to customize it further to achieve a custom result. The whole sample functionality can be divided into three parts:
1. We use the ASPxPivotGrid.FieldValueTemplate property to assign a custom header template. You can use a simpler sample project demonstrating this approach in the Create Header or Field Value Templates and replicate existing look-and-feel example. Note that in this example we replace the default filter button with a custom one created dynamically.
2. To get information about the filter applied to a specific field, we use the PivotGridFieldBase.FilterValues and PivotGridFieldBase.GetUniqueValues properties. To pass filter information from the server to the client, we simply convert filter values to strings. This solution can be not enough in some situations. In this case, it might be necessary to update the code accordingly.
3. To populate ASPxGridView with data at runtime and apply the specified filter to the ASPxPivotGrid control, we use the ASPxClientPivotGrid.PerformCallback and ASPxClientGridView.PerformCallback methods. The client-side row selection functionality is provided by the ASPxGridView's built-in Selection feature.
How to add the ASPxValidationSummary control to ASPxGridView's EditForm
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 convert and then print an GridView extension by using the XtraReport
This example demonstrates how to dynamically create a report based upon the GridView extension at runtime. This means that all filtering, sorting and grouping conditions selected in the grid are also applied in a report. To accomplish this task, it is necessary to create a report with all the necessary bands, bind it to a data source and adjust all the necessary options. You can use this approach if you need to display content of templated columns in your report or insert a report based on GridView to another report.
As it is impossible to get the GridView extension state (its filtering, groping, sorting info), the Session is used to pass the last GridView state to the controller.
See also:
E4476: How to convert and then print an ASPxGridView by using the XtraReport
Example Comments
Added By: Kiran Pratapagiri at: 7/3/2013 3:46:27 AM
Hi,
Thanks for the example.
I think I found the problem with this example. It's not exporting the last column of the Grid.
Please correct the example to export the last column into report.
Thanks
How To: Add Resources to ASPxScheduler Bound to ObjectDataSource
This example demonstrates how to add Resources to the ASPxScheduler control by implementing the ObjectDataSource component for resources. The project includes the ResourceHelper class to provide Resources data.
See Also:
How to bind ASPxScheduler to ObjectDataSource
How to bind ASPxScheduler to MS SQL Server database
How to Format Cell Values
The following example shows how to format data that corresponds to 'Quantity' and 'Unit Price' data fields in a sample ASPxPivotGrid control.
For the 'Quantity' field the PivotFieldBase.CellFormat property is used to format data in a custom manner. Values that correspond to this field are enclosed with round brackets. The formatting settings specified by the PivotFieldBase.CellFormat property also affect the representation of total and grand total cells.
The 'Unit Price' field is bound to a field that contains currency data. By default the cell values that correspond to such fields are formatted as currency amounts (the formatting settings are determined by the regional settings). For English (United States) culture the currency values are represented using two digits to the right of the decimal point. In the example, the PivotFieldBase.GrandTotalCellFormat property is used to format grand total cell values for the 'Unit Price' field in a different manner. The data in these cells is formatted as integer currency values (without fractional portions).
Example Comments
Added By: Alan Gali Dev at: 12/20/2012 10:42:00 AM
how can I extend this to apply to entire pivotgrid? I would like all data cells with numeric values to have default formatting of N2 for example.
I'd prefer to not have to loop through all the fields of the pvg as they may be too many
getting error at online demo http://codecentral.devexpress.com/E1874/
Added By: Andrew Aks (DevExpress) at: 8/7/2013 6:40:37 AMWe already fixed this problem. Please try running this demo again.
How to implement an editable ASPxPivotGrid
This example demonstrates how to allow end-users to modify data cell values within the ASPxPivotGrid.
How to implement a custom map data provider
This example illustrates how to implement a custom map data provider class inherited from the MapDataProviderBase type.
How to: Disable Property Editors Based on a Business Rule
This example demonstrates how to hide and disable property editors via the Conditional Appearance module (the obsolete Conditional Editor State module is used in versions prior to 11.2). The complete description is available in the How to: Disable Property Editors Based on a Business Rule help topic.
GridView - How to bind a master-detail grid to search results
This example demonstrates how to pass search parameters to the master grid Partial View and pass the master row key to the detail grid Partial View to bind grids to correct data.
In the "Index" View, search parameters are passed to the View as a Model. So, when the "Search" Button is clicked, the model is submitted.
To pass search parameters to the master GridView, I have used the action route values collection. Then, in the "OrdersGridPartial" action, these parameters are used to get the correct Model, which will be used to bind the master GridView to the search result. To pass these parameters to this action on a GridView callback, I have passed them to the GridViewSettings.CallbackRouteValues collection by using the ViewData.
The same approach is used to pass the master row key to the detail GridView and bind it to the correct detail data.
How to manage user settings (reset, merge, import, export, etc.) stored in the database instead of a file system
Refer to the A reusable XAF module for storing model settings in the database (security system type insensitive!) forum thread for more details about this solution.
To use this custom module in your project, do the following:
1. Include the DatabaseUserSettings project into your solution;
2. Rebuild your solution and invoke the Module Designer for the YourSolution.Module project as described in the corresponding documentation;
3. Locate the DatabaseUserSettings component in the Toolbox and drop it on the designer surface as described in the "Add a Custom Module" section.
Check out the Application Solution Components help article for more details on using custom XAF modules.
IMPORTANT NOTES
Be aware of the following issue with this example: User settings may be duplicated/overridden under certain circumstances after merging configurator and user settings applied to the same element
Example Comments
Added By: Pawel Rymarczyk 1 at: 5/20/2012 9:35:40 AM
Hi,
Not working with DbUpdater 11.2.
Ticket: http://www.devexpress.com/Support/Center/Question/Details/Q400938
Added By: Sandro Welter (Intelligix) at: 7/6/2012 1:14:37 PMHi,
I need this example in 12.1 version. Thanks.
Added By: Robert Fuchs at: 7/11/2012 11:25:44 AM> Take special note that it is important to grant write permissions for
> your persistent model differences classes to the anonymous user:
AFAIR the new security system does not need an anonymous user any more?
Added By: Miles at: 7/12/2012 3:44:42 PM12.1 version please!
Added By: Frank (DataJunxion) at: 8/11/2012 2:00:41 AM12.1 version?
Added By: John Botibol at: 9/12/2012 4:09:39 AMHi Guys, the Issue (Q421353) mentioned above as one to be aware of is marked as private so this is quite tricky!
Added By: Paolo Parente at: 10/31/2012 10:21:27 AMHi, is there a way to download the whole solution, without select every single file?
Thanks,
Paolo
Ok, i did it.
But now i've a question: i can i deploy the new Model.xafml when a new version of the application has been developed?
Thanks,
Paolo
I have the same problem as Paolo: How to handle the case when a new softare version with another Model.xafml must be distributed? Is there a ay to do this?
Added By: Dennis (DevExpress Support) at: 11/6/2012 3:03:35 PMI have answered your question about deploying the new version in http://www.devexpress.com/Support/Center/Issues/ViewIssue.aspx?issueid=Q443198
Added By: Robert Fuchs at: 12/15/2012 1:38:45 PMhttp://www.devexpress.com/issue=Q421353 is still private.
Is it fixed in the 12.2 example?
Iuse linq queries and Custom fields on model.xafml following http://www.devexpress.com/Support/Center/Example/Details/E859. I get exception on project start up: An error with number 1009 has occurred.
Error message: Error occurs while adding the 'FieldName_Linq' custom property ('System.Double' property type) to the 'MyClassName' type: 'Object reference not set to an instance of an object.'
Guys, please refer to the public http://www.devexpress.com/issue=Q470416 ticket instead of the private Q421353 one.
Added By: Mr292 at: 1/30/2013 8:44:44 PMDennis, Thanks a lot for this. I had implemented something similar before but I have now moved to your code so as to take advantage of any future changes.
I have a few questions though
1. Does the Model.xafml in the Program Folder get hit at all? It does not seem like it from the code, but wanted to be sure.
2. I had implemented a feature where on exit, the configurator would be prompted to store changes. I have modified this to do the same but in my implementation, the user was being prompted twice. This I have noticed is an issue with a lot of functions in XAF but is usually solvable easily. In this instance, what should I check for to disable the consecutive prompt?
3. Lastly, Just so some users are aware I was having issues saving Chart/Pivot Settings as XML in MySQL if I use latin1 in innodb. Not your fault but I had implemented a BLOB save instead to get over that.
How can I logon by Configurator user, if domain authentication used?
Added By: Nate Laff at: 4/12/2013 11:09:31 AMImplemented this yesterday after using the example of this from a long time ago (admin mode) and overall I like it.
Administrator users in my opinion shouldn't be able to see the User Settings navigation item. Unfortunately Q485525 prevents this from happening easily. Or am I missing something that this should be visible to Administrator. Seems like only Configurator should see it.
Added By: Nate Laff at: 4/16/2013 5:29:56 PMAlso, this has been an issue since the first iterations of this. If you make changes to the Win model at the highest level (Model.xafml) such as moving the location of MyDetails, these changes always get messed up. In the current scenario, MyDetails shows up in the navigation group I specified, but also gets duplicated in the default group after you logon with the Configurator user. Does this happen to anyone else?
Added By: Nate Laff at: 4/16/2013 6:03:33 PMAlso, what's the process here? Let's say you want to make a global change to a view as Configurator..
Log on as Configurator
Make changes
Exit
Log on as Configurator
Manage User Settings action, import from source Configurator to all users
Exit
Log on as User
Verify changes
Is that the process? Am I missing something. The exits are required?
Also, you can't reset to defaults without opening Model Editor as configurator, resetting there, exiting, manage user settings and import from Configurator source again?
Just trying to make sure I have this process down correctly.
Added By: Nate Laff at: 5/2/2013 2:06:59 PMDennis?
Added By: zacarias de prado habela at: 7/26/2013 7:31:49 AMHi:
Where is "XPManageUserSettingsParameter", "XPUserSettings", XPUserSettingsAspect defined?
Thanks
These classes are defined in the DatabaseUserSettings module. Use the Visual Studio search facilities to locate them...
How to use the LayoutView/CardView as a master View in master-detail mode
This example illustrates how to emulate a master-detail mode for the LayoutView/CardView.
Example Comments
Added By: Marcus Gabriel at: 8/20/2013 2:44:10 PM
A screenshot how the result looks would help to quickly find out if this sample is what someone is looking for.
Added By: Svetlana (DevExpress Support) at: 8/20/2013 4:05:06 PMHi,
I have added an image showing how the application works. Thank you for your idea.
How to filter ASPxGridView bound to SqlDataSource by using an external ASPxComboBox in ASPxRoundPanel
This example demonstrates how to filter the ASPxGridView bound to SqlDataSource via the ControlParameter. The ControlParameter is passed to the SqlDataSource from an external ASPxComboBox. The ASPxComboBox is inside ASPxRoundPanel. Use the following syntax to find the ASPxComboBox inside the ASPxRoundPanel: ASPxRoundPanelID$ASPxComboBoxID.
See also:
E2041
DXMap Getting Started - Lesson 3 - Load Shapes Data from a Shapefile
This is the third tutorial of the DXMap Getting Started series. It will guide you through the process of creating a map application with shapes, loaded from an external Shapefile.
How to replace default filter items with custom ones
In some situation it can be helpful to replace default items with custom ones. E.g. if you have too many items they can be convenient for grouping them based upon certain criteria and displaying group items in a filter popup. It is possible to handle the CustomFilterPopupItems event to remove default items and add group items instead. To apply a filter based upon the selected by end-users, handle the FieldFilterChanging event.
How to implement the Rest service based on an ASP.NET WebAPI application
This example demonstrates how to implement the Rest service based on an ASP.NET WebAPI application.
See also:
How to configure ODataService for a DevExtreme HTML5/JS application
Creating a REST service using ASP.NET Web API
An Introduction To RESTful Services With WCF
How to implement CRUD operations with a DataSource
How to animate a map pushpin
This example illustrates how to provide animation for a map pushpin.
To do this, it is necessary to create a PushpinLocationAnimation object and assign it to the MapPushpin.LocationChangedAnimation property. After that it becomes possible to customize the animation duration (PushpinLocationAnimation.Duration) and easing function (PushpinLocationAnimation.EasingFunction).
In addition, you can change the pushpin state after its location animation is complete via the PushpinLocationAnimation.Completed event. In this example, this event is used to change the pushpin location randomly each time the bouncing animation effect is complete.
How to define bar customization actions
This example shows how to define bar customization actions in a DataTemplate. In the example, various actions are demonstrated: actions used to create bars and bar items, add bar items to the bar and submenus, and remove bar items.