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

ASPxReportDesigner - How to register a custom control in the Designer's toolbox


dxNumberBox - How to allow entering only integer/float numbers

$
0
0

This example demonstrates how to allow entering only numbers in dxNumberBox. For this task we need to handle the dxNumberBox.onKeyPress event and check whether the typed symbol is a number. If this is not a number, prevent the default action of the event by calling the preventDefault method of the event object that is passed to the onKeyPress event handler.

See also:
JavaScript RegExp

Question Comments

Added By: CM Tee at: 6/18/2015 9:06:10 PM    

hi, the syntax on view got error during runtime,

<div class="dx-field-value">
                   <div data-bind="dxNumberBox: integerSettings { value: qty, min: 1 }"></div>
               </div>

please help.

Added By: Alex Skorkin (DevExpress Support) at: 6/19/2015 1:20:53 AM    

Hello Jerry, 
To process your recent post more efficiently, I created a separate ticket on your behalf: T257499: The syntax for dxNumberBox interger values got error during runtime. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.

Added By: Jake Reece at: 4/24/2018 2:07:09 PM    The event name is onKeyPress, not onkeyPress.

How to: Use the OpenStreetMap Search Service Via the Map Control

$
0
0

This example demonstrates how to add an image layer displaying map tiles from the OSM service and an information layer that searches for a place on the map using the OSM search service.

The example uses the following classes:

ImageLayer - A layer that displays map images obtained from map image data providers.
OpenStreetMapDataProvider - The provider that loads map images from a web resource that provides data in the OpenStreetMap format.
InformationLayer - A layer that displays additional geo information above the map.
OsmSearchDataProvider - Provides search using the Open Street Map service.

How to: Use the OpenStreetMap Geocode Service Via the Map Control

$
0
0

This example demonstrates how to add an image layer displaying map tiles from the OSM service and an information layer that searches for a place on the map using the OSM search service.

The example uses the following classes:

ImageLayer - A layer that displays map images obtained from map image data providers.
OpenStreetMapDataProvider - The provider that loads map images from a web resource that provides data in the OpenStreetMap format.
InformationLayer - A layer that displays additional geo information above the map.
OsmGeocodeDataProvider - Provides search using the Open Street Map service.

How to disable some dates in DateEdit

$
0
0

This example shows how to disable a custom set of dates in the DateEdit control.

The main idea of the approach is to add a collection of disabled dates to the DateEdit's Tag property and disable corresponding calendar buttons by using a DataTrigger with a custom MultiConverter. This MultiConverter checks if a date associated with a certain button exists in the collection of disabled dates. If so, the button's IsEnabled property is set to False.

 

To avoid posting disabled data when the keyboard is used instead of the mouse, the implementation of the DateEditCalendar class and its OnCellButtonClick method was also changed. This custom DateEditCalendar is used in DateEdit's popup with the help of an implicit style for the DateEdit type.

You can use a similar approach for disabling dates based on another rule, for example, prohibit selecting weekends. For this, modify the CellEnabledConverter class to implement the required logic.

How to implement sidebar navigation shown in demos

$
0
0

This example illustrates our brand new design for demos, which was implemented in version 17.2.
It contains all the functionality with searching and navigation between different items that are represented in our main demo site.
The main sections are:
- Header
- Sidebar - Navigation and Search panels
- Main Content
The header panel is placed on the Default page and contains a button to show/collapse the sidebar and some info about the page that is selected from the sidebar is shown.
The sidebar contains user controls - Navigation and Search user controls. Navigation is implemented using ASPxTreeView and bound to an XML source to show what section the site contains. The Search user control is implemented using ASPxNavBar in which search results are shown. Search and navigation functionalities are implemented using the client-side code in the ~/Content/Site.js" file.

How to use a Background Geolocation in XAF Mobile

$
0
0
This example demonstrates how to take advantage of a mobile device positioning system in your XAF mobile application using the Cordova Background Geolocation plugin and Cordova Device plugin . Additionally, you will learn how to access the PhoneGap config file (regular XML file) and add the plugin to your application.

 

Scenario:
You want to automatically track movements of an XAF mobile application user and display the user's route on the map, e.g., in a separate administrative XAF Web application:




Your feedback is needed!
This is not an official feature of our Mobile UI (CTP) and our API may change in future release cycles. We are publishing this article prior to the 17.2 release to collect early user feedback and improve overall functionality. We would appreciate your thoughts on this feature once you've had the opportunity to review it. Please report any issues, missing capabilities or suggestions in separate tickets in our Support Center. Thanks for your help in advance!

Prerequisites
Install any v17.1.5+ version.
The implementation steps below are given for a new application, though they can be applied to any other XAF mobile app.

Steps to implement
1. 
Create a new XAF solution with Web and Mobile platforms and enable the Maps Module in it.  Do not forget to specify the MapsAspNetModule > GoogleApiKey property in the Application Designer invoked for the YourSolutionName.Web/WebApplication.xx file.

2. In the YourSoltutionName.Mobile/MobileApplication.xx file, register the Cordova Background Geolocation plugin by adding required tags to the MobileApplication.AdditionalPhoneGapPlugins collection.
[C#]
usingDevExpress.ExpressApp.MobilepublicpartialclassBackgroundGeolocationMobileApplication:MobileApplication{publicBackgroundGeolocationMobileApplication(){AdditionalPhoneGapPlugins.Add(@"<plugin name=""cordova-background-geolocation-lt"" source=""npm"" spec=""2.7.3""><variable name=""LOCATION_ALWAYS_USAGE_DESCRIPTION"" value=""Background location-tracking is required"" /><variable name=""LOCATION_WHEN_IN_USE_USAGE_DESCRIPTION"" value=""Background location-tracking is required"" /><variable name=""MOTION_USAGE_DESCRIPTION"" value=""Using the accelerometer increases battery-efficiency by intelligently toggling location-tracking only when the device is detected to be moving"" /><variable name=""LICENSE"" value=""YOUR_LICENSE_KEY"" /></plugin>");AdditionalPhoneGapPlugins.Add(@"<plugin name=""cordova-plugin-device"" source=""npm"" spec=""1.1.6""></plugin>");// ...
[VB.NET]
Imports Microsoft.VisualBasicImports DevExpress.ExpressApp.MobilePartialPublicClass BackgroundGeolocationMobileApplicationInherits MobileApplicationPublicSubNew() AdditionalPhoneGapPlugins.Add("<plugin name=""cordova-background-geolocation-lt"" source=""npm"" spec=""2.7.3"">"& ControlChars.CrLf &" <variable name=""LOCATION_ALWAYS_USAGE_DESCRIPTION"" value=""Background location-tracking is required"" />"& ControlChars.CrLf &" <variable name=""LOCATION_WHEN_IN_USE_USAGE_DESCRIPTION"" value=""Background location-tracking is required"" />"& ControlChars.CrLf &" <variable name=""MOTION_USAGE_DESCRIPTION"" value=""Using the accelerometer increases battery-efficiency by intelligently toggling location-tracking only when the device is detected to be moving"" />"& ControlChars.CrLf &" <variable name=""LICENSE"" value=""YOUR_LICENSE_KEY"" />"& ControlChars.CrLf &" </plugin>") AdditionalPhoneGapPlugins.Add("<plugin name=""cordova-plugin-device"" source=""npm"" spec=""1.1.6""></plugin>")' ...
Take note of the line which adds the "LICENSE" tag. If you have a license key (refer to the corresponding remark in the README file), uncomment this code and replace the YOUR_LICENSE_KEY placeholder with your own key .

3.
 In the YourSolutionName.Module project, copy the BackgroundGeolocation.Module\BusinessObjects\DeviceInfo.xx file to the BusinessObjects folder.
This file contains business classes used to store background geolocation data received from mobile clients. You may want to put these classes into separate files according to your code rules.

4. In the YourSolutionName.Mobile project, create a new Geolocation folder and copy the several code files below into it as per the instructions below.
4.1. Copy the BackgroundGeolocation.Mobile\Geolocation\GeolocationScript.js file and include it in the project. Change the Build Action property for this file to Embedded Resource. This code initializes the Cordova Background Geolocation plugin with default settings. Feel free to modify it according to your needs. More information about configuring options can be found in the project's github repository.

4.2. Copy the BackgroundGeolocation.Mobile\Geolocation\GeolocationJsonObject.xx file and include it in the project.
These classes are used to deserialize JSON data set by mobile applications to the Geolocation Service.

4.3. 
Copy the BackgroundGeolocation.Mobile\Geolocation\GeolocationHttpHandler.xx file and include it in the project. 
The Background Geolocation plugin will send data to this service. The service is intended to save the device information to the database. It uses the connection string from the application configuration file (Web.config).

To enable the HTTP handler added on the previous step, add the following line to the configuration/system.webServer/handlers section of the YourSolutionName.Mobile/Web.config file (you may need to change the type attribute value and specify the namespace qualified name of the GeolocationHttpHandler class declared in your project:

[XML]
<addname="Geolocation"verb="GET,POST"path="GeolocationProcessingService.svc"type="YourSolutionName.Mobile.GeolocationHttpHandler"/>

5.  In the YourSoltutionName.Mobile/MobileApplication.xx file, register the GeolocationScript.js code (copied on step #4.1) using the MobileApplication.RegisterClientScriptOnApplicationStart method so that this script executes when the mobile application starts up on the device. The code snippet below demonstrates how to implement the ReadResource and ReadResourceString methods required to load the code from the embedded resource into a String variable (you can find this code in the BackgroundGeolocation.Mobile/MobileApplication.xx file of the sample project): 
[C#]
publicBackgroundGeolocationMobileApplication(){// ...stringgeolocationScript=ReadResourceString("BackgroundGeolocation.Mobile.Geolocation.GeolocationScript.js");RegisterClientScriptOnApplicationStart("GeolocationScript",geolocationScript);}publicstaticbyte[]ReadResource(stringresourceName){byte[]buffer=null;using(Streamstream=Assembly.GetExecutingAssembly().GetManifestResourceStream(resourceName)){if(stream!=null){buffer=newbyte[stream.Length];stream.Read(buffer, 0,(int)stream.Length);}}returnbuffer;}publicstaticstringReadResourceString(stringresourceName){byte[]resourceBytes=ReadResource(resourceName);//You need to escape CRLF characters in versions prior to version 18.1//return Encoding.UTF8.GetString(resourceBytes).Replace("\r\n", "\\r\\n");returnEncoding.UTF8.GetString(resourceBytes);}
[VB.NET]
PublicSubNew()' ...Dim geolocationScript AsString = ReadResourceString("GeolocationScript.js") RegisterClientScriptOnApplicationStart("GeolocationScript", geolocationScript)EndSubPublicSharedFunction ReadResource(ByVal resourceName AsString) AsByte()Dim buffer() AsByte = NothingUsing stream As Stream = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream(resourceName)If stream IsNot NothingThen buffer = NewByte(stream.Length - 1){} stream.Read(buffer, 0, CInt(stream.Length))EndIfEndUsingReturn bufferEndFunctionPublicSharedFunction ReadResourceString(ByVal resourceName AsString) AsStringDim resourceBytes() AsByte = ReadResource(resourceName)'You need to escape CRLF characters in versions prior to version 18.1'Return Encoding.UTF8.GetString(resourceBytes).Replace(ControlChars.CrLf, "\r\n")Return Encoding.UTF8.GetString(resourceBytes)EndFunction

The value passed to the ReadResourceString method consists of two parts in C# projects: the default assembly namespace ("BackgroundGeolocation.Mobile") and the path to the resource file ("Geolocation.GeolocationScript.js"). The first part may be different in your project. In VB.NET projects, the resource name will be much simpler: "GeolocationScript.js". 

6. In the YourSolutionName.Module.Web project, install the Newtonsoft.Json NuGet package and copy the BackgroundGeolocation.Module.Web\Controllers\DisplayGeolocationController.xx file to the Controllers folder.
This controller is intended to draw the client's route based on location points.

7. Build and deploy your mobile application following the steps described in the Install the Application to a Smartphone  help article, and ensure that the Geolocation services are enabled in the mobile device settings.
Once you get your mobile app running on your actual device, wait a few minutes and then run the Web version of your XAF application. Open the DeviceInfo List View, and you will see a record containing your mobile device information. If you click the ListView record, you will be navigated to the DetailView that contains the Map demonstrating the route tracked by the Background Geolocation module.

See Also:
eXpressApp Framework > Getting Started > XAF Mobile (CTP) Tutorial
How to: Use a Custom Plugin in a Mobile Application

XAF Mobile - Overview Video
FAQ: New XAF HTML5/JavaScript mobile UI (CTP)
Using Maps in a Mobile Application 
How to send push notifications to the XAF Mobile application using Azure Notifications Hub
How to use a Barcode Scanner in XAF Mobile

Question Comments

Added By: Roman Max at: 8/22/2017 2:27:38 PM    Hi, do you mind posting Project ZIP file here? Somehow having difficulty running it.Added By: Uriah (DevExpress Support) at: 8/22/2017 11:11:51 PM    Hi Roman,


I've created a separate ticket on your behalf (T548156: Provide project ZIP file for T540129 example). It has been placed in our processing queue and will be answered shortly.

Added By: Scott Gross at: 11/2/2017 1:21:38 PM    heading and altitude needs to be changed to double instead of int. I was getting that exception on the HttpHandler.Added By: Uriah (DevExpress Support) at: 11/14/2017 2:18:18 AM    Thank you, Scott! We have updated the example accordingly.

ASPxGridView Context menu - How to add a row copy to a specific position

$
0
0

This example demonstrates how to add a row copy to a specific position of ASPxGridView. The FillContextMenuItems event handler is used to add a copy item to the context menu. When a user clicks the copy item, the CreateValuesDictionary method creates a copy of fields of the current row. Then, this copy is used to populate fields of the new row in the InsertNextToGridDataSet method. To keep the order of rows, it is necessary to set up an extra column to store order indexes; and then sort the ASPxGridView by this column.


How to use a hyperlink whose argument depends on several cell values in the ASPxGridView

$
0
0

It is an often situation when a developer should include sever field values in a hyperlink shown in a GridView column cells. The best solution to this problem is to use templates. The attached example shows how this can be done and suggests two similar approaches:
1) using ASPxHyperLink: the NavigateUrl property of ASPxHyperLink is defined by the KeyValue of the processed row

2) using the <a> element: the href parameter of the <a> element is defined in the server side GetRowValue method.

Update:
If you want to use GridViewDataHyperLinkColumn and preserve its functionality, use unbound columns instead of the DataItem template. Please refer to the ASPxGridView - How to create GridViewDataHyperLinkColumn whose URL depends on several column values example for more information. 

Question Comments

Added By: smoore4 at: 12/17/2013 3:33:38 AM    

This also works. Use a Command Column (eg Custom Button) and code it like this:

        protected void ASPxGridView1_CustomButtonCallback(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewCustomButtonCallbackEventArgs e)
        {

            if (e.ButtonID == "cmdOpenSurveyRpt")
            {

                object[] m_rptvars = (object[])ASPxGridView1.GetRowValues(e.VisibleIndex, "survey_id", "survey_user_id");

                ASPxWebControl.RedirectOnCallback("~/Reports/ReportViewer.aspx" + "?sid=" + m_rptvars[0] + "&uid=" + m_rptvars[1]);

            }

        }

How to update the ProgressBarControl from a separate thread

$
0
0

Very often when you perform any operation in a background thread, it can be very useful to indicate to an end-user the current state of progress. To display the progress, the ProgressBarControl can be used. This example illustrates how to perform a file copy operation in a background thread, and display the progress on a main form.

Question Comments

Added By: John Nicol_1 at: 4/26/2018 11:08:03 AM    Do you have a VB code example that uses this example?

Thanks Added By: Nadezhda (DevExpress Support) at: 4/26/2018 11:33:58 AM    

Hello,

I've created a separate ticket on your behalf (How to update the ProgressBarControl from a separate thread using VB ). It has been placed in our processing queue and will be answered shortly.

How to implement a Theme Selector control similar to DevExpress Demo

$
0
0

The sample provides two web user controls (ThemeSelector, ThemeParametersSelector) that can be used in your project. To use these controls in your solution, execute these steps:

1. Copy the following files, taking into account their location:

   a. An xml file with theme groups and themes: Themes.xml;
   b. Classes that are responsible for getting and presenting data from Themes.xml: ThemeGroupModel.cs, ThemeModel.cs, ThemeModelBase.cs, ThemesModel.cs;
   c. sprite.svg with images;
   d. sprite.css and StyleSheet.css with CSS classes;
   e. Script.js with client-side methods;   
   f. ThemeSelector.ascx, ThemeSelector.ascx.cs, ThemeParametersSelector.ascx and ThemeParametersSelector.ascx.cs;
   g. Utils.cs - a class that is responsible for manipulations with themes.

2. Register the ThemeSelector and ThemeParametersSelector web user controls in your web.config file:

[ASPx]
<pages><controls> ...<addsrc="~/UserControl/ThemeParametersSelector.ascx"tagName="ThemeParametersSelector"tagPrefix="dx"/><addsrc="~/UserControl/ThemeSelector.ascx"tagName="ThemeSelector"tagPrefix="dx"/></controls></pages>

3. In the sample, a chosen theme is written to a cookie. To apply this theme from the cookie, subscribe to the Application.PreRequestHandlerExecute event in your Global.asax file and handle it in the following manner:

[C#]
protectedvoidApplication_PreRequestHandlerExecute(objectsender,EventArgse){DevExpress.Web.ASPxWebControl.GlobalTheme=Utils.CurrentTheme;Utils.ResolveThemeParametes();}

4. Add the ThemeSelector and ThemeParametersSelector user controls to ASPxPanel of the master page:

[ASPx]
<formid="form1"runat="server"><header><dx:ASPxPanelrunat="server"ClientInstanceName="TopPanel"CssClass="header-panel"FixedPosition="WindowTop"EnableTheming="false"><PanelCollection><dx:PanelContent><aclass="right-button icon cog right-button-toggle-themes-panel"href="javascript:void(0)"onclick="DXDemo.toggleThemeSettingsPanel(); return false;"></a></dx:PanelContent></PanelCollection></dx:ASPxPanel></header><divclass="main-content-wrapper"><sectionclass="top-panel clearfix top-panel-dark"><dx:ASPxButtonrunat="server"Text="Change Theme Settings"CssClass="theme-settings-menu-button adaptive"EnableTheming="false"AutoPostBack="false"ImagePosition="Right"UseSubmitBehavior="false"><ImageSpriteProperties-CssClass="icon angle-down theme-settings-menu-button-image"/><FocusRectBorderBorderWidth="0"/><ClientSideEventsClick="DXDemo.toggleThemeSettingsPanel"/></dx:ASPxButton></section><dx:ASPxPanelrunat="server"ClientInstanceName="ThemeSettingsPanel"CssClass="theme-settings-panel"FixedPosition="WindowRight"Collapsible="true"EnableTheming="false"ScrollBars="Auto"><SettingsCollapsingAnimationType="Slide"ExpandEffect="PopupToLeft"ExpandButton-Visible="false"/><Styles><ExpandBarWidth="0"/><ExpandedPanelCssClass="theme-settings-panel-expanded"></ExpandedPanel></Styles><PanelCollection><dx:PanelContent><divclass="top-panel top-panel-dark clearfix"><dx:ASPxButtonrunat="server"Text="Change Theme Settings"CssClass="theme-settings-menu-button"EnableTheming="false"AutoPostBack="false"ImagePosition="Right"HorizontalAlign="Left"UseSubmitBehavior="false"><ImageSpriteProperties-CssClass="icon angle-down theme-settings-menu-button-image"/><FocusRectBorderBorderWidth="0"/><ClientSideEventsClick="DXDemo.toggleThemeSettingsPanel"/></dx:ASPxButton></div><divclass="theme-settings-panel-content"><dx:ThemeSelectorID="ThemeSelector"runat="server"/><%if(Utils.CanApplyThemeParameters){%><dx:ThemeParametersSelectorID="ThemeParametersSelector"runat="server"/><%}%></div></dx:PanelContent></PanelCollection></dx:ASPxPanel></div><divstyle="clear: both;"><asp:ContentPlaceHolderID="ContentPlaceHolder1"runat="server"></asp:ContentPlaceHolder></div></form>

See also:
How to implement a Theme Selector control similar to DevExpress Demo ThemeSelector web user control

How to implement a Theme Selector control similar to DevExpress Demo (Old Style)

$
0
0

The sample provides a web user control(ThemeSelector) that can be used in your project. To use this control in your solution, execute these steps:

1. Copy following files, taking into account their location:

   a. an xml file with theme groups and themes: Themes.xml.

   b. classes that are responsible for getting and presenting data from Themes.xml: ThemeGroupModel.cs, ThemeModel.cs, ThemeModelBase.cs, ThemesModel.cs.

   c. Sprite.png with images.

   d. ThemeSelector.css with css classes.

   e. ThemeSelector.ascx and ThemeSelector.ascx.cs.

2. Register the ThemeSelector web user control in your web.config file:

[ASPx]
<pages><controls><addsrc="~/UserControl/ThemeSelector.ascx"tagName="ThemeSelector"tagPrefix="dx"/></controls></pages>

3. In the sample, a chosen theme is written to a cookie. To apply this theme from the cookie, subscribe to the Application.PreRequestHandlerExecute in your Global.asax file and handle it

in the following manner:

[C#]
protectedvoidApplication_PreRequestHandlerExecute(objectsender,EventArgse){if(Request.Cookies["CurrentThemeCookieKey"]!=null){DevExpress.Web.ASPxWebControl.GlobalTheme=Request.Cookies["CurrentThemeCookieKey"].Value;}}

4. The ThemeSelector control allows you to show a popup left or right relative to the "Themes" anchor. Use the ThemeSelector.PopupAlign property. The default value is PopupAlign.Right. 

[ASPx]
<dx:ThemeSelectorrunat="server"ID="ts2"PopupAlign="Left"/>


Starting with v17.2 we have changed our Theme Selector implementation. Now, this user control is placed to ASPxPanel and is mobile friendly. A new sample can be found in the following thread: How to implement a Theme Selector control similar to DevExpress Demo

How to color dashboard item elements in the Web Viewer

$
0
0
Note: Starting with v17.1, we recommend using the ASPxDashboard control or a corresponding ASP.NET MVC extension to display dashboards within web applications.

The following example demonstrates how to color dashboard item elements using the ItemElementCustomColor event.
In this example, chart series points, whose values exceed specified thresholds, are colored in green. Chart series points, whose values fall below specified thresholds, are colored in red.
Pie segments, whose contributions in total fall below the specified threshold, are colored in orange.

See also:
T188083: How to color dashboard item elements in the WinForms Viewer

How to color dashboard item elements in the WinForms Viewer

$
0
0

The following example demonstrates how to color dashboard item elements using the DashboardViewer.DashboardItemElementCustomColor event.
In this example, chart series points, whose values exceed specified thresholds, are colored in green. Chart series points, whose values fall below specified thresholds, are colored in red.
Pie segments, whose contributions in total fall below the specified threshold, are colored in orange.

See also:
T198119: How to color dashboard item elements in the Web Viewer

ASPxListBox - How to implement a hyperlink in items of a specific column

$
0
0

This example demonstrates how to implement a hyperlink in column items using the ListBoxColumnCellTemplateContainer. A click on an item's hyperlink invokes a popup window with additional information about the item.

Question Comments

Added By: Narasimhan Aravamudhan at: 4/27/2018 1:47:27 AM    I have tried below example but response was "Element 'celltemplate' is not supported "
for your information i am using dev express 12.2.9.0
if you can share some example using this version of devexpress it will be useful for me
Added By: Vova (DevExpress Support) at: 4/27/2018 2:18:04 AM    

Hello,

I've created a separate ticket on your behalf (T630543: ASPxListBox - How to implement a hyperlink in items of a specific column in version 12.2). It has been placed in our processing queue and will be answered shortly.


How to use the Document Iterator object to iterate over document elements

$
0
0
This example creates a DocumentIterator instance for the current document and calls its MoveNext method to iterate over document elements. A Visitor pattern is implemented to process a document element. The implementation is done by calling each element's Accept  method with the MyVisitor object instance as a parameter. 
MyVisitor 
is a custom class which descends from the DocumentVisitorBase class and provides a method that processes DocumentText elements to enclose Bold text in asterisks and return all characters without formatting. Paragraph ends are replaced with newline symbols, other document elements are skipped.
You can customize MyVisitor class to perform any operation with any type of element which the DocumentIterator encounters.

How to obtain a collection of available WMS layers in the RensponseCapabilities event handler

$
0
0

This example demonstrates how to obtain a collection of layers supported by the Web Map Service.

Question Comments

Added By: Ralf Lüthke at: 4/30/2018 2:15:10 AM    This example doesn't seem to work for the server URI "http://wms.geo.admin.ch/". When I run it with that URI, I get the list of layers. But after selecting a layer, no request is generated and sent to the WMS and the map remains empty. An exception is not thrown. I tried some other sample URIs which worked as expected. What is the reason for the blank map? Has it to do with the EPSG code (2056)?Added By: Alex (DevExpress Support) at: 4/30/2018 2:42:16 AM    

Hi Ralf,

I've created a separate ticket regarding your inquiry (T631082: Unable to obtain a collection of WMS layers). It has been placed in our processing queue and will be answered shortly.

How to implement the Drag&Drop mechanism between TileView and GridView

$
0
0

This example demonstrates how to drag and drop entries between two GridControl views - TileView and GridView.

Question Comments

Added By: Santiago Moscoso at: 4/30/2018 9:21:34 AM    How would you enable Drag and Drop inside the Tileview to reorder the items or change item from one group to another?

Word Processing Document API Examples

$
0
0

This example demonstrates how to use the Word Processing Document API to programmatically manage rich edit documents, without the need for Microsoft Word to be installed.

The application includes the RichEditControl used to display and edit the code. The code modifies the rich document created or loaded by the RichEditDocumentServer instance. To see the results, open the document in Microsoft Word by clicking the button.

You can modify the code and watch the result. If an error occurs during compilation or execution, the backcolor of the code window changes.

This sample introduces API properties and methods used to perform the following operations:

- Create, load, save and print documents;
- Insert text to the document range or paragraph;
- Change paragraph or character formatting;
- Create and apply new character, paragraph or linked style;
- Create bulleted or numbered lists;
- Insert and resize inline pictures;
- Insert and modify floating pictures or text boxes;
- Create, fill, colorize tables, merge or split table cells;
- Change document page layout - create columns, add line numbering, change page layout settings;
- Insert bookmarks or hyperlinks;
- Create, edit and delete comments;
- Set document properties;
- Modify page headers; 
- Insert and modify fields.

For more information, review the Examples section in the documentation.

To use this example in production code, the Universal Subscription or an additional Document Server Subscription is not required.

How to calculate routes from major roads using the Bing Map Route web service

$
0
0

This example demonstrates how to calculate routes to the destination point from major roads using the BingRouteDataProvider.CalculateRoutesFromMajorRoads method.

Before route calculation, specify destination point coordinates (GeoPoint.Latitude and GeoPoint.Longitude). In addition, you can specify optional parameters: the destination name, driving or walking route travel mode using the BingRouteOptions.Mode property and route optimization options to calculate an optimal route either by time or by distance via the BingRouteOptions.RouteOptimization property.

To start the application, click the Calculate Routes From Major Roads button. All parameters are passed to the CalculateMajorRouteRequest method, and you can see the results in the rich text box element and calculated routes on a map.

The requested results contain the total distance of a route, itinerary item (BingRouteResult.Distance, BingRouteLeg.Distance, BingItineraryItem.Distance), the time required to follow the calculated route (BingRouteResult.Time) and pass the rout leg and itinerary item (BingRouteLeg.Time, BingItineraryItem.Time). You can also see the maneuvers associated with the itinerary item (BingItineraryItem.Maneuver) and other parameters.

Note that if you run this sample as is, you will get a warning message informing that the specified Bing Maps key is invalid. To learn how to register a Bing Maps account and create a key for it, refer to the How to: Get a Bing Maps Key tutorial.

See also: Bing Maps - Information Data Providers (Search, Geocode, Routing) upgrade from SOAP to REST API.

Viewing all 7205 articles
Browse latest View live


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