This example demonstrates how to implement date range filtering in the GridView extension.
Use the MVCxGridViewColumn.SetFilterTemplateContent method to create a custom editor and assign a delegate method to the GridViewSettings.ProcessColumnAutoFilter property to process a custom filter expression sent from the client side.
GridView - How to implement date range filtering using a custom editor in the AutoFilterRow
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
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
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
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.
ASPxDataView - How to highlight the selected item
This example demonstrates how to highlight an item of ASPxDataView if a user focused it by clicking.
How to create a custom exporter for the PivotGridControl by using the XtraReport suite
This example illustrates how to dynamically create a custom report based on PivotGridControl content.
It also implements the following suggestions:
S130430
S91257
AS9011
and the S18650 suggestion for printing facilities.
Example Comments
Added By: Darshan Bansal at: 5/21/2013 2:50:18 PM
Hello,
We are trying to implement this in our pivotgrid... we are getting an error under method FillDatasetColumns. We are getting an object reference not set to an instance of an object at line "tempColumnText +=pcea.GetFieldvalue(field).ToString()+ " | " Do not know what would be causing this??
Added By: AntonyC at: 7/31/2013 5:30:20 AMWould this allow for the export of a chart linked to the PivotGrid control?
How to create a custom exporter for the ASPxPivotGrid control by using the XtraReport suite (This exporter provides the AutoRowHeight, BestFit and FitToPage features)
This is an ASP version of the How to create a custom exporter for the PivotGridControl by using the XtraReport suite example.
How to print or export a report from code without first previewing it
This sample illustrates how you can print or export a report from code in a Silverlight application.
The solution has the following projects:
- E3422: a Silverlight client application.
- E3422.Web: a web application hosting the Silverlight client and the ReportService.
- Reports: contains application reports (in this example, it is the SampleReport class).
- ReportServiceClientTools: utility classes to work with the ReportService from code.
Example Comments
Added By: Mukesh Chandra at: 1/2/2014 6:27:43 AM
Is it possible to print a report from code without previewing it in v2011.1.12
Added By: Igor D (DevExpress) at: 1/3/2014 10:07:06 AMI've updated the example and published a version compatible with the DXperience version 11.1.12. I would also strongly recommend upgrading, since version 11.1 is very old.
How to update the Document Preview according to the changes made in GridControl
This sample demonstrates how you can create a report document from a GridControl, and update its Document Preview on the same page, by clicking a button.
Runtime detail height sizing with respect to XRSubreport size
In a single detail band an XRLabel and XRSubreport are placed side-by-side. The goal is to resize the XRLabel height to match the accompanying XRSubreport. This may be accomplished by calling CreateDocument twice. The first call sums the brick height of each subreport section and adds this float value to the dictionary under its category key. On the second CreateDocument call, the DetailBand.BeforePrint handler resizes each detail from the section sizes in the dictionary.
How to remove standard bar items and add custom ones to the DocumentPreview toolbar
This example demonstrates how to customize the DocumentPreview control's toolbar.
In particular, it shows how you can remove a standard button from it, and add custom ones.
You can tie your custom logic to a button either in the BarManager.ItemClick event handler, or using the View Model commands.
See Also:
How to override existing export (send) command handlers in the DocumentPreview toolbar
How to use the Simple Link
The following example demonstrates how to use the SimpleLink class to print data from a non-hierarchical data source.
See also: How to use the CollectionView Link
How to use the CollectionView Link
The following example demonstrates how to use the CollectionViewLink class to print data from a hierarchical data source, which implements the ICollectionView interface.
See also: How to use the Simple Link
How to load a report from a REPX file
This example demonstrates how you can restore a report from its definition file by customizing the default Report Service behavior.
How to bind a dxChart plugin from ChartJS library to ASPxPivotGrid
This example demonstrates how to obtain the chart datasource using the IDataSource interface implemented by the ASPxPivotGrid, convert data to the JSON format and pass it to the client via a custom JS property added to the ASPxPivotGrid.
Example Comments
Added By: at: 2/14/2013 8:16:06 AM
I tried the below example and I am getting the following exception. I was able to successfully build the project though..
Server Error in '/' Application.
--------------------------------------------------------------------------------
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: Could not load file or assembly 'DevExpress.Web.ASPxPivotGrid.v12.2, Version=12.2.0.0, Culture=neutral, PublicKeyToken=79868b8147b5eae4' or one of its dependencies. The system cannot find the file specified.
Source Error:
Line 1: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="DxSample.Default" %>
Line 2:
Line 3: <%@ Register Assembly="DevExpress.Web.ASPxPivotGrid.v12.2, Version=12.2.0.0, Culture=neutral, PublicKeyToken=79868b8147b5eae4" Namespace="DevExpress.Web.ASPxPivotGrid" TagPrefix="dxpg" %>
Line 4:
Line 5: <!DOCTYPE html>
Source File: /default.aspx Line: 3
Assembly Load Trace: The following information can be helpful to determine why the assembly 'DevExpress.Web.ASPxPivotGrid.v12.2, Version=12.2.0.0, Culture=neutral, PublicKeyToken=79868b8147b5eae4' could not be loaded.
=== Pre-bind state information ===
LOG: User = JAMOCHAHQ\sathish.rao
LOG: DisplayName = DevExpress.Web.ASPxPivotGrid.v12.2, Version=12.2.0.0, Culture=neutral, PublicKeyToken=79868b8147b5eae4
(Fully-specified)
LOG: Appbase = file:///D:/workspace/BAP/BAP Application/BAPTestpages/
LOG: Initial PrivatePath = D:\workspace\BAP\BAP Application\BAPTestpages\bin
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: D:\workspace\BAP\BAP Application\BAPTestpages\web.config
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Post-policy reference: DevExpress.Web.ASPxPivotGrid.v12.2, Version=12.2.0.0, Culture=neutral, PublicKeyToken=79868b8147b5eae4
LOG: The same bind was seen before, and was failed with hr = 0x80070002.
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272
I added the jquery ui resize and drag properties to the div around the charting component. However when the div is resized, the svg chart is not resized, it stays orphaned from the parent div control.
How do I set 'id' to the SVG or set the width and height of the SVG to be 100% so that when I resize the parent div control, even the svg is resized accordingly.
Below is my aspx code.
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="DxSample.Default" %>
<%@ Register Assembly="DevExpress.Web.ASPxPivotGrid.v12.2, Version=12.2.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
Namespace="DevExpress.Web.ASPxPivotGrid" TagPrefix="dxpg" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title></title>
http://www.devexpress.com/Support/Center/css/dxtreme.desktop.default-12.2.css
http://www.devexpress.com/Support/Center/css/site.css
http://www.devexpress.com/Support/Center/css/jquery-ui-1.10.1.custom.min.css
<script type="text/javascript" src="js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="js/knockout-2.1.0.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.10.1.custom.min.js"></script>
<script type="text/javascript" src="js/globalize.js"></script>
<script type="text/javascript" src="js/dxtreme.core-12.2.js"></script>
<script type="text/javascript" src="js/dxtreme.framework-12.2.js"></script>
<script type="text/javascript" src="js/dxtreme.viz-12.2.js"></script>
<script type="text/javascript" src="js/index.js"></script>
<script>
$(function () {
$("#charts").resizable();
});
$(function () {
$("#charts").draggable();
});
</script>
</head>
<body style="vertical-align: middle">
<form id="form1" runat="server">
<div style="width: 600px; margin: 0 auto;">
<br />
<dxpg:ASPxPivotGrid Width="600px" runat="server" DataSourceID="salesPersonSource"
ID="pivotGrid" ClientInstanceName="pivotGrid">
<Fields>
<dxpg:PivotGridField FieldName="CategoryName" Area="RowArea" />
<dxpg:PivotGridField FieldName="ProductName" Area="FilterArea" />
<dxpg:PivotGridField FieldName="Country" Area="ColumnArea" />
<dxpg:PivotGridField FieldName="Sales Person" Area="FilterArea" />
<dxpg:PivotGridField FieldName="Extended Price" Area="DataArea" />
</Fields>
<ClientSideEvents EndCallback="function(s, e) { window.DxSample.updateChartData(pivotGrid.cpChartData);}" />
</dxpg:ASPxPivotGrid>
<br />
<asp:AccessDataSource runat="server" SelectCommand="select Country, ProductName, CategoryName, [Extended Price], [Sales Person] from SalesPerson"
ID="salesPersonSource" DataFile="~/app_data/nwind.mdb" />
<div id="charts" style="width:600px;height:400px;background-color: #eeeeff; float: right; border-style: solid; margin: 0px; padding:10px"
data-bind="dxChart: { commonSeriesSettings: { argumentField: 'argument' }, series: series, dataSource: dataSource, tooltip:{enabled:true}}" />
</div>
</form>
</body>
</html>
Hello Sathish,
I have created a Support Center ticket on your behalf to discuss this issue: DXTREME - The Chart is not automatically resized. Please bear with us, we will answer your question as soon as possible.
Added By: david karasek at: 5/8/2013 8:47:06 AMWas this ever resolved? Is there a complete example and guide of inter-operability between DxTreme and and Dxperience? In an AJAX context, what is the best practice for these to work well together?
Wouldn't change events in the grid need to be triggered via AJAX so as not to do a full page refresh?
In addition what is the best process for this working in MVC? The same as ASP web forms? Different?
Hello David,
I have create a new ticket on your behald to discuss your questions: Few question about interaction between DevExpress ASP.NET components and DXTREME Mobile widgets?. Please bear with us, we will ge back to you as soon as possible.
How to show chart legend with markers in separate control
This example illustrates how to show a ChartControl legend in a GridControl.
How to apply theme to DevExpress ASP.NET Control Descendant
How to apply a theme to a DevExpress control descendant
To apply a theme to Custom Control that uses some of DevExpress controls you need to apply a global theme for the page or for the entire application. In order to do that, use the ThemeDeployer tool to copy necessary files to your project folder. Note that our controls may use other simple controls, for example ASPxComboBox. So it is a good idea to copy files for all the controls.
After that you need to add some code to the page's Init event handler:
[C#]formLayout.CssPostfix=this.Page.Theme;
The CssPostfix property is related only with DevExpress controls and cannot be used with standard ASP.NET controls.
How to show file system items in the TreeList and load required icons for each item
This example demonstrates how to show file system items in the TreeList control and load icons for each file system item.
DXCharts Getting Started - Lesson 1 - Create a Simple Chart
This example demonstrates how to create a simple chart, populate it with data and adjust its common settings.