The main idea is to handle the jQuery.ajaxSuccess event for some element which is raised after each callback.
Starting with 13.2 version we've introduced the MVCxClientGlobalEvents object that allows accomplishing this task automatically(see the ASP.NET MVC - Provide the capability to handle the CallbackError event globally (implement an ASPxGlobalEvents equivalent))
How to perform certain actions after each callback(prior 13.2)
Building a simple expense tracking application using DXGrid for WPF - example solution
This solution includes ready-to-use project templates for the KA18728: Building a simple expense tracking application using DXGrid for WPF. Introduction article.
Switch to the edit mode by clicking a status bar button or by double-clicking a row
This tutorial shows you how to use client-side functions to switch the grid to the edit mode. Two UI solutions are implemented in this sample:
- End-users can click a button embedded into the grid's status bar.
- End-users can double-click the desired grid row.
How to use the MultiSelect mode in the LookUpEdit
We have implemented the MultiSelect mode in the LookUpEdit as an extension. To use it, you will need to add a reference to the DevExpress.Xpf.Grid.Extensions library and assign MultiSelectLookUpEditStyleSettings to the LookUpEdit StyleSettings property. If you wish to select records on a click basis (without the CTRL modifier), customize the editor's PopupContentTemplate and use the OneClickSelectionView as a GridControl view. Please note that the LookUpEdit does not support text editing in the MultiSelect mode.
Example Comments
Added By: Adel Ayyam at: 1/6/2014 5:50:47 PM
Hi Devexpress,
The example is not working as expected when IsTextEditable="True", when searching by some text and selecting corresponding items the selecteditems is always empty ???
Best regards,
Ayyam
Hi Ayyam,
I've created a separate ticket regarding this issue: http://www.devexpress.com/Support/Center/Question/Details/Q465097. We will process your inquiry there.
Thanks,
Alex
How to show Hierarchical Resources in SchedulerListEditor (WinForms)
The XtraScheduler Suite provides the capability to show hierarchical resources via the Resources Tree control. This scenario is not currently supported in XAF out-of-the-box. The example demonstrates how to employ this feature by creating a custom ShedulerListEditor descendant.
Example Comments
Added By: Willem de Vries at: 4/3/2013 5:24:21 AM
Thank you DX, for providing this example! This is what i needed to present complex planning info in a comprehensible way to my users!
How to display an image in a group row
This example demonstrates how to display an image in a group row.
In this project a column's group row is painted using different approaches:
The ID column:
The CustomDrawGroupRow event is handled in order to perform custom group row painting.
The Subject column:
Handle the GridView.CustomColumnDisplayText event in order to specify e.DisplayText with an HTML image tag. An image can be accessed either from a bound image collection or from project resources.
The Status column
An in-place ImageComboBoxEdit is used as a column edit and its SmallImages is set to an image collection.
For more information refer to KA18890.
How to change default menu items and actions in the popup menu
This demo project shows and how to add a new menu item and assign a built-in scheduler action to it.
The project is composed of two pages, you can switch between them by using a button at the top left.
The page named DefaultItemWithCustomAction illustrates how to change the default action assigned to a menu item. It uses two different techniques to modify the existing menu.
One technique involves a JavaScript function defined in the page markup that replaces the default GoTo command with a custom handler. The PopupMenuShowing event is handled to specify a JavaScript handler.
Another technique implements a CustomMenuViewCallbackCommand that is used to perform a callback. The BeforeExecuteCallbackCommand event should be handled to process the command. The PopupMenuShowing event is handled to rename a menu item so it can be properly recognized by a custom callback command.
The page named CustomItemWithDefaultAction adds two new menu items - MyOpenAppoinment that executes a built-in "Open Appointment" command and Make Important item that executes the same command as a menu item that labels the appointment as "Important". The name for the menu item is obtained from a corresponding item contained in the "Label As" submenu.
How to invoke different forms via the popup menu
Problem:
I'd like to customize the popup menu so that it contains additional menu items and clicking on them invokes my custom controls (web forms).
Solution:
Explore this example to see how you can accomplish this task. Right-click the appointment to see custom menu items which invoke user forms.
The code uses PreparePopupMenu event to modify the default menu, and AppointmentFormShowing event to specify the forms to show. The server callback is performed with the MyMenuAppointmentCallbackCommand class instance, inherited from the DevExpress.Web.ASPxScheduler.Internal.MenuAppointmentCallbackCommand class.
Example Comments
Added By: Rajesh Sundramoorthy at: 10/4/2013 8:33:01 AM
Hi,
Can I Create a custom actions in the custom form. example in form1 i put some editors and do some manipulation or logic with the value selected ? How can i achive this ?
Thanks in advance.
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
End-User Restrictions - How to define "availability" intervals for different resources
This example illustrates how to define different time intervals that are available for scheduling. This information is stored in the ~\App_Data\ResourcesAvailabilities.mdb database. It has the ResourcesAvailabilities table with the following schema:
Id: Integer,
ResourceId: String,
StartTime: DateTime,
EndTime: DateTime
So, generally, each resource can have independent availability intervals. This information is loaded and exposed via the ResourcesAvailabilities class.
First of all, we use this information to modify the default appearance of the Time Cells by handling the ASPxScheduler.HtmlTimeCellPrepared Event. Then, we disallow appointment creation and modification actions if their execution is initiated outside available intervals. For this, we substitute the regular MenuViewCallbackCommand with a custom one (see Callback Commands), and handle the ASPxScheduler.AppointmentChanging Event. Note that we use a technique from the How to show user friendly message from the server on a callback ticket to show a warning if the end-user tries to schedule an appointment in the restricted area. In other words, we handle the ASPxScheduler.CustomJSProperties Event on the server side to pass a warning message on the client side. This message is intercepted in the ASPxClientScheduler.EndCallback Event.
Here is a screenshot that illustrates a sample application in action:
See Also:
End-User Restrictions - How to allow appointment creation or deletion only for specific users
End-User Restrictions - How to allow appointment modification or deletion depending on custom field values
End-User Restrictions - How to implement a client-side confirmation on deleting an appointment
Example Comments
Added By: Kriss at: 8/15/2013 8:33:08 AM
Can you please convert this example to work with SQL Server too(reading the resources), it will be nice to have it?
Thanks
Kriss
GridView - How to use the jQuery autocomplete plugin with ASP.NET WebApi
The Autocomplete plugin allows you to implement the functionality that helps end-users find and select values from a pre-populated list while typing. It also allows loading this list on demand by using AJAX requests to a remote service, which reduces the page rendering time.
ASP.NET Web API is a framework that makes it easy to build HTTP services that reach a broad range of clients, including browsers and mobile devices. ASP.NET Web API is an ideal platform for building RESTful applications in the .NET Framework.
This example demonstrates how to combine these features for the GridView's EditForm editor.
Main points are:
1) Add a WebApi Controller to the Controllers folder and define a method that returns a portion of data depending on the typed text;
2) Register a WebApi route as it described in the Routing in ASP.NET Web APIarticle;
3) Add references to the jQuery and jQuery UI libraries;
4) Handle the client-side Init event for the corresponding editor;
Now it is possible to implement the autocomplete functionality. When the end-user types text into the "FirstName", the text is obtained from the editor and assigned to Autocomplete's select attribute. Then an AJAX request is sent to the server and calls the corresponding method in WebApi. The result of the request is returned to the client and used for Autocomplete's source attribute.
See also:
jQuery Autocomplete, MVC4, and WebAPI
How to implement ASPxTextBox in AutoFilterRow with the jQuery AutoComplete plugin
How to export selected appointments to iCalendar file
This demo illustrates the use of a custom popup menu command to export selected appointments to the file in iCalendar format. It employs the iCalendarExporter Constructor, which takes a collection of appointments for export.
Select several appointments by clicking them while holding the Ctrl key. Hover over one of them for the smart tag to appear. Click the smart tag and select the Export command in the context menu.
Review the iCalendar support article for more information.
How to filter appointments by custom field values
This example illustrates how to filter appointments by custom field values. A particular value is selected via the ASPxComboBox. In the ASPxClientComboBox.SelectedIndexChanged event handler this value is stored in the HiddenField and the scheduler is refreshed via the ASPxClientScheduler.Refresh() method. Then, on the server side, the ASPxScheduler.FilterAppointment event handler is fired. The value from the HiddenField is used to filter appointments.
How to add a new appointment using the information displayed in a separate control (combo box)
This example illustrates how to create an Appointment programmatically. An end-user selects an appointment type using a separate control (ASPxComboBox). To initialize the newly created appointment, the ASPxScheduler1.Storage.CreateAppointment method is used.
How to construct an appointment editing form with custom fields
This example is created by following the step-by-step guide available from the link below:
How to: Modify the Appointment Editing Form for Working with Custom Fields
How to print ASPxScheduler via the XtraSchedulerReport on a separate web page
This example illustrates how to print ASPxScheduler on a separate web page. For this an invisible ASPxScheduler is placed to this web page (ReportingPage.aspx). This is the simplest method to connect the XtraSchedulerReport to the underlying data (appointments and resources). Note also that you can avoid using invisible ASPxScheduler. This approach is demonstrated in the Can you generate a XtraSchedulerReport preview/print without having an ASPxScheduler control? thread.
See also:
How to print the ASPxScheduler using a Report Preview
DXCharts Getting Started - Lesson 2 - Bind Chart Series to Data
This lesson explains how to manually add a series to the chart's diagram, and then bind this series to the data source.
Note that although in this tutorial we will use the Microsoft Access database (.mdb), the ChartControl can be bound to a variety of other data providers. For more information on data binding, refer to the Providing Data section.
How to store data to a local file using PhoneGap API
This example demonstrates how to store data to a local file using PhoneGap API. To access a corresponding API, it is necessary to add a link to the cordova.js file.
This example can be tested only on a mobile device.
See also:
PhoneGap Documentation - File
How to build a native package in Visual Studio
How to test PhoneGap API via the Courier tool
Example Comments
Added By: Andrea Tatone at: 7/25/2013 2:14:40 PM
Many thanks for the example. I've tried it in the simulator and the courier, but it doesn't work (i'm working on a android 2.3.4 device). It fails with the message "File system is not accessible", either in read and write. Is there anything I can do?
Added By: Nikolai (DevExpress Support) at: 7/26/2013 2:18:07 AMHi Andrea,
I have created a separate ticket regarding this issue. Please post all messages here Q377803.
How to sort stacked bar chart bars by the sum of the corresponding values
This example demonstrates how to implement a custom sorting algorithm to sort stacked bar chart bars by the total values. Please refer to the ChartStackedSorting.SortChartSeries() method for details on how it can be done.
How to show custom forms and controls in XAF (Example)
This example implements the following scenarios when an end-user clicks on a custom item in the navigation control:
- a custom non-XAF form is opened as a result;
- a standard XAF View containing a custom user control is opened as a result.
Both custom forms and user controls display persistent data from the XAF application database. For that purpose, this example solution provides a set of reusable elements (custom ViewItem and Application Model extensions) organized in a way that you can once implement them in an XAF module and reuse to display custom user controls in various forms.
Take special note that if you do not need your custom controls to display data from the application database or do not require a complex and reusable solution for this task,
you can use (recommended)a much simpler and built-in XAF solution - ControlDetailItemplaced within a DashboardView.
If this is not your case, proceed to the instructions below:
1. Define a base structure of the navigation control in your XAF application, as shown in the E911.Module\Model.DesignedDiffs.xafml file.
You can simply copy and paste the contents of the NavigationItems element into the corresponding file (pre-opened via the text editor) of your platform-agnostic module.
The same customizations can be achieved via the Model Editor visually.
This navigation structure will be further customized in the WinForms and ASP.NET executable projects later.
2. Intercept events of the navigation control to display a custom form when a custom navigation item is clicked.
To do this, implement a WindowController into your platform-agnostic module and handle events of the ShowNavigationItemController class as per the E911.Module\Controllers\ShowCustomFormWindowController.xx file. This controller will be abstract and be overridden in WinForms and ASP.NET modules.
3. Declare a custom ViewItem class that is supposed to host a custom user control in the standard XAF View. To do this, implement a custom ViewItem descendant and related types in the platform-agnostic module as shown in the E911.Module\Editors\CustomUserControlViewItem.xx file.
This ViewItem will also be abstract and platform-agnostic as it will not create platform-dependent controls, and will just provide a common customization code for both platforms. For instance, the OnControlCreated method will be overridden to bind the created control to data. To access persistent data from the database used by an XAF application, the ViewItem will implement the IComplexViewItem interface that consists of a single Setup method, receiving the IObjectSpace and XafApplication objects as parameters.
To unify our data binding code for both platforms, the IXpoSessionAwareControl interface and an auxiliary XpoSessionAwareControlInitializer class are introduced.
The interface provides a single UpdateDataSource method that is implemented by custom forms and user controls to bind them to data received by means of XPO.
You can use a similar mechanism and modify these auxiliary types to pass other custom data into your custom forms and controls.
4. Define a base structure of the standard XAF View with a custom ViewItem as shown in the E911.Module\Model.DesignedDiffs.xafml file.
You can simply copy and paste the contents of the Views element into the corresponding file (pre-opened via the text editor) of your platform-agnostic module.
5. Create custom forms and user controls in WinForms and ASP.NET executable projects analogous with what is shown in the example. The easiest way to do this is to copy the contents of the E911.Win\Controls and E911.Web\Controls folders and then include the necessary files into your solution. Take special note that these custom forms and controls implement the IXpoSessionAwareControl interface to automatically receive persistent data and other parameters when they are created.
6. Implement platform-dependent behavior to open and customize custom forms and controls. To do this, copy the following files into your WinForms and ASP.NET module projects:
WinForms:
E911.Module.Win\Controllers\WinShowCustomFormWindowController.xx - contains an WinForms version of the WindowController, which is inherited from the platform-agnostic
E911.Module.Win\Editors\WinCustomUserControlViewItem.xx - contains an WinForms version of the ViewItem, which is inherited from the platform-agnostic one;
E911.Module.Win\WinModuleEx.xx - contains a registration code for WinForms version of the ViewItem;
ASP.NET:
E911.Module.Web\Editors\WebCustomUserControlViewItem.xx - contains an ASP.NET version of the ViewItem, which is inherited from the platform-agnostic one;
E911.Module.Web\WebModuleEx.xx - contains a registration code for ASP.NET version of the ViewItem;
E911.Module.Web\Controllers\WebShowCustomFormWindowController.xx - contains an ASP.NET version of the WindowController, which is inherited from the platform-agnostic one;
These platform-dependent versions of the WindowController and ViewItem are required to implement the creation and display of custom forms and controls using the means specific for each platform. They are also designed to provide the capability to be able to set custom forms and control settings via the Model Editor. For that purpose, custom Application Model extensions are implemented for the Navigation Item and View Item model elements.
7. Set the custom forms and controls settings for each platform.
To do this, copy the contents of the E911.Win\Model.xafml and E911.Web\Model.xafml files into the Model.xafml file in the executable WinForms and ASP.NET projects:
WinForms:
ASP.NET:
IMPORTANT NOTES
1. It is also possible to mix the traditional and XAF development approaches (consult our Support Team if you are not sure how to integrate your standard non-XAF solution into XAF), because an XAF application is a regular .NET application built of reusable blocks like View, ViewItem, Property and List Editors, etc. that eventually create and customize platform-dependent controls exactly the same way you do this without XAF. So, using XAF does not mean something absolutely new and allows you to reuse your existing development skills and practices. Of course, it is possible to create your own reusable blocks if the standard ones do not meet your needs. For instance, the example of a custom View class designed to show a custom form can be found on CodeProject here.
2. This solution contains some generic code (e.g., base WindowController and ViewItem) that is mainly required because our XAF application is for both Windows and the Web. You may avoid this generic code and make a simpler implementation if you are developing for only one platform.
3. You can display custom forms not only when interacting with the navigation control, but from any other place. To do this, intercept the events of a required entity, e.g., an XAF Controller, Action or a View. Refer to the product documentation or consult with our Support Team in case of any difficulties.
4. By default controls layout and user customizations are preserved only for built-in XAF ListEditors, because they have special code for that. If you embed a custom user control into XAF, you need to preserve its settings yourself as well, exactly like you would do when implementing this task in the "old way" in a non-XAF application. Refer to the control's documentation to learn more on how to accomplish this task.
Feel free to contact the respective product team if you experience any difficulties customizing this control.
See also:
How to show custom forms and controls in XAF
How to create controls dynamically
How much of XAF's default UI is customizable.
How to Show a Window via an Action
How to: Invoke a List View for a Non-Persistent Class
How to: Display a Non-Persistent Object's Detail View from the Navigation
ShowNavigationItemController.CustomShowNavigationItem Event
XafApplication.CustomProcessShortcut Event
Example Comments
Added By: kenngo at: 11/6/2012 5:24:10 AM
Hi, I would like the custom from to be tabbedMDI, how to set this in the controller class?
Added By: Dennis (DevExpress Support) at: 2/1/2013 9:12:45 AM@Ngo Ken Hui:
Refer to the Q391718 ticket that describes a possible solution.
i have a problem in CustomUserControlViewItem.cs file
in line "new XpoSessionAwareControlInitializer(Control as IXpoSessionAwareControl, theObjectSpace);"
the Control is converted to null
Please submit a new ticket and attach your problematic project there:
http://www.devexpress.com/Support/Center/Question/Create
We will be glad to help you.
The downloaded solution states it is for " v13.1".
The latest version I am aware of is 12.2?
Added By: Carl Howarth 1 at: 10/11/2013 7:00:36 AMJust in case anyony else hits the issue where the model.CustomControlTypeName is null; there are some additional model settings that are not included in the example code below (but are in the actual download).
Have a look at the XML for the E911.Module.Win/Web Model.xafml. You will notice that there are settings within these files that are not detailed below (it may be obvious to some based on the article but I missed it and it cost me the best part of a day).
Win version:
<Application>
<NavigationItems>
<Items>
<Item Id="Default">
<Items>
<Item Id="CustomForm" CustomFormTypeName="E911.Module.Win.Controls.WinCustomForm" />
</Items>
</Item>
</Items>
</NavigationItems>
<Views>
<DashboardView Id="StandardFormWithCustomUserControl">
<Items>
<CustomUserControlViewItem Id="CustomUserControlViewItem" CustomControlTypeName="E911.Module.Win.Controls.WinCustomUserControl" />
</Items>
</DashboardView>
</Views>
</Application>
Web version:
<Application>
<NavigationItems>
<Items>
<Item Id="Default">
<Items>
<Item Id="CustomForm" CustomFormPath="Controls/WebCustomForm.aspx" />
</Items>
</Item>
</Items>
</NavigationItems>
<Views>
<DashboardView Id="StandardFormWithCustomUserControl">
<Items>
<CustomUserControlViewItem Id="CustomUserControlViewItem" CustomControlPath="Controls/WebCustomUserControl.ascx" />
</Items>
</DashboardView>
</Views>
</Application>
Hope this helps.
Cheers
Carl