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

How to implement the master detail GridView with editing capabilities

$
0
0

This example illustrates how to implement the master detail GridView with editing capabilities.
Perform the following steps to define the master-detail layout:
1) Define both master and detail GridView settings within separate PartialView files (see the Using Callbacks);
2) Set the master grid's SettingsDetail.ShowDetailRow property to "True";
3) Define the master grid's DetailRow content via the SetDetailRowTemplateContent method and render the detail grid's PartialView inside.

Note:
Values passed in a detail grid's CallbackRoute must have a unique name and must not replicate any other names on a page: Q577974: GridView - "The parameters dictionary contains a null entry for parameter 'id' of non-nullable type 'System.Int32'" error occurs when canceling editing in the detail GridView


See also:
GridView - Advanced Master-Detail View
A simple example of master-detail grids with editing capabilities

Question Comments

Added By: Wilson Vargas at: 10/20/2012 12:08:04 PM    

This sample not compile!

 settings.DataBinding = (sender, e) => {
            ((MVCxGridView)sender).ForceDataRowType(typeof(DevExpress.Razor.Models.Person));

Added By: WillAutio at: 3/24/2014 1:37:52 PM    

Excellent - just what I needed!

Added By: Paul Astro at: 8/27/2014 12:21:12 PM    

Hello Support,

Is there a ASP.NET version for this exact same example?  Please supply URL link......  thanks.

Added By: Anthony (DevExpress Support) at: 8/27/2014 11:49:39 PM    Hello,

Please refer to the A simple example of master-detail grids with editing capabilities example.Added By: venu koneru at: 4/15/2015 12:06:30 PM    

The below code is the master page partial view
@{
var grid = Html.DevExpress().GridView(settings => {
       settings.Name = "GridViewptconfig";
       settings.CallbackRouteValues = new { Controller = "PTTEST", Action = "GridViewPartialptconfig" };

       //settings.SettingsEditing.AddNewRowRouteValues = new { Controller = "PTTEST", Action = "GridViewPartialptconfigAddNew" };
       //settings.SettingsEditing.UpdateRowRouteValues = new { Controller = "PTTEST", Action = "GridViewPartialptconfigUpdate" };
       //settings.SettingsEditing.DeleteRowRouteValues = new { Controller = "PTTEST", Action = "GridViewPartialptconfigDelete" };
       //settings.SettingsEditing.Mode = GridViewEditingMode.EditFormAndDisplayRow;
       //settings.SettingsBehavior.ConfirmDelete = true;

       //settings.CommandColumn.Visible = true;
       //settings.CommandColumn.ShowNewButton = true;
       //settings.CommandColumn.ShowDeleteButton = true;
       //settings.CommandColumn.ShowEditButton = true;
       

settings.KeyFieldName = "ptConfigId";                

settings.SettingsPager.Visible = true;
settings.Settings.ShowGroupPanel = false;
settings.Settings.ShowFilterRow = false;
settings.SettingsBehavior.AllowSelectByRowClick = false;
       settings.SettingsBehavior.AllowSort = false;

       settings.SettingsDetail.ShowDetailRow = true;
       settings.SettingsDetail.AllowOnlyOneMasterRowExpanded = true;
       settings.SetPreviewRowTemplateContent(c =>
               Html.RenderAction("GridViewPartialResult",
new { MasterId = DataBinder.Eval(c.DataItem, "ptConfigId") }));

               settings.Columns.Add("ptConfigId");    
               settings.Columns.Add("ptProductId");                
settings.Columns.Add("freq");
settings.Columns.Add("volt");
settings.Columns.Add("sens");
settings.Columns.Add("ppk");
});
if (ViewData["EditError"] != null){
       grid.SetEditErrorText((string)ViewData["EditError"]);
   }
}
@grid.Bind(Model).GetHtml()

Added By: venu koneru at: 4/15/2015 12:10:04 PM    

The below code is the detail page view
-------------------------------------------------

@{
var grid = Html.DevExpress().GridView(settings => {
       settings.Name = "GridViewResult";
       settings.CallbackRouteValues = new { Controller = "PTTEST", Action = "GridViewPartialResult" };

settings.SettingsEditing.AddNewRowRouteValues = new { Controller = "PTTEST", Action = "GridViewPartialResultAddNew" };
       settings.SettingsEditing.UpdateRowRouteValues = new { Controller = "PTTEST", Action = "GridViewPartialResultUpdate" };
       settings.SettingsEditing.DeleteRowRouteValues = new { Controller = "PTTEST", Action = "GridViewPartialResultDelete" };
       settings.SettingsEditing.Mode = GridViewEditingMode.EditFormAndDisplayRow;
       settings.SettingsBehavior.ConfirmDelete = true;

settings.CommandColumn.Visible = true;
       settings.CommandColumn.ShowNewButton = true;
       settings.CommandColumn.ShowDeleteButton = true;
       settings.CommandColumn.ShowEditButton = true;

settings.KeyFieldName = "ptConfigId";

settings.SettingsPager.Visible = true;
settings.Settings.ShowGroupPanel = true;
settings.Settings.ShowFilterRow = true;
settings.SettingsBehavior.AllowSelectByRowClick = true;

       settings.SettingsDetail.MasterGridName = "GridViewptconfig";

settings.Columns.Add("ptConfigId");
settings.Columns.Add("fesample");
settings.Columns.Add("feresult");
settings.Columns.Add("nfesample");
settings.Columns.Add("nferesult");
settings.Columns.Add("sssample");
settings.Columns.Add("ssresult");
});
if (ViewData["EditError"] != null){
       grid.SetEditErrorText((string)ViewData["EditError"]);
   }
}
@grid.Bind(Model).GetHtml()

Added By: venu koneru at: 4/15/2015 12:10:34 PM    

Are the Master detail code correct.

Added By: Alessandro (DevExpress Support) at: 4/15/2015 12:26:42 PM    

Hello,

To process your recent post more efficiently, I created a separate ticket on your behalf: T231079: GridView - Master-Detail implementation. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.

Added By: Jack Lakes at: 11/28/2016 3:46:15 PM    Just tried to implement this project, however, the following does not work because it can't find it.

using DevExpress.Razor.Models;

I tried to add it to my reference, but I can't find a devexpress razor file anywhere.  Can you help me understand what I am doing wrong?  -- Thanks
Added By: Helen (DevExpress Support) at: 11/29/2016 3:28:53 AM    Hi Jack,

I see that the issue was resolved in the context of the Can't find DevExpress.Razor.Models; thread. Should you have further questions, don't hesitate to contact us. Added By: Brien King at: 3/2/2017 8:49:25 PM    This example has a few problems that make it not a very good example for a real world application.

1) Your model uses static properties for the children.  This is not typically done with a class that has children as the properties are generally specific to the instance.

2) You are storing the child data in the session.  This is bad for a couple of reasons.

a) This won't work on a server farm as the session could change.

b) If I open up another tab on the same site, the two tabs share the same session.  This only works in this demo because you assign everything an ID.  However, in a lot of cases (real world) all the ID's would be ZERO until they were actually saved to the database.

How to: Handle the Hyperlink Click Event to Invoke the Custom Form

$
0
0
The following example demonstrates how to manually implement complex hyperlink behavior by handling the HyperlinkClick event.
In this example, this event handler is used to invoke a form with a list of data. The end-user can select the item from the pop-up list and it automatically replaces the hyperlink content.

How to insert an image from a database into ASPxHtmlEditor by using ImageSelector

$
0
0

This example illustrates how to insert an image stored in a database into the ASPxHtmlEditor form by using ImageSelector.

ASPxHtmlEditor does not have a built-in capability to show binary data stored in a database. Therefore, it is necessary to define a custom handler, which dynamically gets an image from the database and sends it to the user as the handler's response . For this purpose the ASHX generic handler is used. You can learn more about HTTP Handlers here: HTTP Handlers and HTTP Modules Overview.

In the current example images are inserted into the ASPxHtmlEditor form via ImageSelector in the following format:

[ASPx]
<imgsrc="Image.ashx?path=Salvador Dali/1910 - 1927/CrepuscularOldMan.jpg"alt=""/>

 

Update for version 15.1.8 and newer versions

Starting from version 15.1.8, we have added the capability to operate files and folders that are stored in a physical file system, or a database, or cloud services in ASPxHtmlEditor's built-in ASPxFileManager control. 
The ProviderType property is used to specify the type of a storage where a current file system is contained. See the File System Providers Overview topic to learn more. 

To accomplish this task, create your own File System Provider, assign its name to the CustomFileSystemProviderTypeName property and set the ProviderType property to Custom, so the built-in ASPxFileManager control will operate a custom File System Provider.
Use the RootFolderUrlPath property to set the path to an image handler. In this handler, get the image data and write it into Response. 


For older versions:

To accomplish the described task, it is necessary to execute the following steps:

1) Open the SelectImageForm.ascx.cs page;
2) Comment or delete the following code to avoid incorrect RootFolder setting:

[C#]
protectedvoidPrepareFileManager(){//FileManager.Settings.Assign(HtmlEditor.SettingsImageSelector.CommonSettings); //if(string.IsNullOrEmpty(FileManager.Settings.RootFolder)) // FileManager.Settings.RootFolder = HtmlEditor.SettingsImageUpload.UploadImageFolder; ... }

3) Change the FileManager_CustomJSProperties event to set the path to an image handler:

[C#]
protectedvoidFileManager_CustomJSProperties(objectsender,DevExpress.Web.ASPxClasses.CustomJSPropertiesEventArgse){e.Properties["cp_RootFolderRelativePath"]="Image.ashx?path=";}

4) Get an image from a database and show it in the ASPxHtmlEditor form :
  a) Create an image handler (*.ashx );
  b) In this handler, parse Request.QueryString and get an image from a database by using the parsed path;
  c) Write the obtained image into Response.

Question Comments

Added By: Phan Sin Tian at: 3/7/2017 3:37:05 AM    Hi,
The ArtsDB.mdf is unable to open in my environment (mssql 2012)
Can you please provide creation script?
Thanks.

How to emulate a TreeList using the master-detail GridView

$
0
0

This example demonstrates how to override the GridView painting mechanism, and draw lines within the master row indent area, to link a master row with detail rows, like the TreeList does for parent node and its children.

Starting with version 16.1.4, Grid supports the embedded details mode that can be enabled using the DetailMode property. Download version 16.1.4 or higher if you are using this mode.

Question Comments

Added By: Hannes Schneider at: 2/16/2017 1:42:35 AM    Hi, sorry example does not run with ExampleRunner. And I have included the custom control into my project -> code is executed but grid still looks exactly as a normal grid.... is there any improvement on this?Added By: Svetlana (DevExpress Support) at: 2/16/2017 2:37:55 AM    

Hello,

I've created a separate ticket on your behalf (T483659: E2290 cannot be run). It has been placed in our processing queue and will be answered shortly.

A general technique of using cascading ASPxComboBoxes

$
0
0

This demo illustrates a general technique of using cascading ASPxComboBoxes:

1) Handle the parent ASPxClientComboBox's SelectedIndexChanged event and perform the child ASPxComboBox's callback via the ASPxClientComboBox's PerformCallback method;
2) Handle the child ASPxComboBox's Callback event and bind the child ASPxComboBox with the datasource, based on the parent ASPxComboBox's SelectedItem / SelectedIndex property.

Question Comments

Added By: Esa Niemi at: 3/8/2017 1:04:48 AM    The link associated to the Callback event doesn't seem to point to anything sensible anymore.

How to apply master filtering in the Web Dashboard

How to apply master filtering in the ASP.NET MVC Dashboard

ASPxGridView with alphabetic pager

$
0
0

This example illustrates how to create a custom alphabetic pager.
In fact, Alphabetic pager is filtering by a column.
In this example we create a custom pager template, which contains anchors with alphabetic letters. After a click on an anchor the ASPxClientGridView.PerformCallback function is called with a parameter. On the server side, a new custom pager template is created in the ASPxGridView.CustomCallback event handler, and filtering by passed parameters takes place.

Question Comments

Added By: KenK at: 4/24/2015 12:28:14 AM    

How can I do the same on the AspxDataView?

Added By: Vladimir (DevExpress Support) at: 4/24/2015 1:11:06 AM    

Hello Ken,

To process your recent post more efficiently, I created a separate ticket on your behalf: T234416: How to implement a custom pager for ASPxDataView. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.

Added By: Jean-Luc Praz at: 3/9/2017 6:52:33 AM    I thought my customer would be jumping up and down with that nifty paging but after a few days of using it he came back to me saying that he wanted the traditional paging back unless I could find a way to have both the alphabetical paging AND the traditional paging.  Any way of doing this ?

How to export AcroForm data to XML

$
0
0
This example shows how a PDF document with AcroForm data (interactive forms) can be exported to an XML format.

You can also export the AcroForm data document to FDF, XFDF, and TXT formats using the approach described below.

How to import AcroForm data from XML

$
0
0
This example demonstrates how you can import AcroForm data (interactive forms) from XML format to a PDF document.

You can also import the AcroForm data from FDF, XFDF, and TXT formats, as described below.

How to perform a drill-down in MVCxDashboardViewer

$
0
0
The following example demonstrates how to perform a drill-down in MVCxDashboardViewer on the client side.

In this example, the ASPxClientDashboardViewer.PerformDrillDown method is used to perform a drill-down for a specified row in a Grid dashboard item. The dxSelectBox widget contains categories for which a drill-down can be performed. These categories are obtained using the ASPxClientDashboardViewer.GetAvailableDrillDownValues method. Select a required category and click the PerformDrillDown button to perform a drill-down by the selected category.

When the Grid displays a list of products (the bottom-most detail level), you can only perform a drill-up action that returns you to the top detail level. The ASPxClientDashboardViewer.PerformDrillUp method is called to do this.

How to bind TokenBox to a large data source

$
0
0

This example demonstrates how to bind the TokenBox extension to a large data source on the client side.
Create the GetFilteredData method that should return a list of items based on a string filter parameter. Then, handle the client-side MVCxClientTokentBox KeyUp event and execute the GetFilteredData method using jQuery ajax.

Create the setData method on the client side. After that, remove items that were added earlier and add new items to the TokenBox item collection in the setData method. Note that for certain purposes, it is possible to disable adding custom tokens using the AllowCustomTokens property. 

To reduce the server overload by avoiding unnecessary requests, it is recommended to add the ASPxClientComboBox.BeginUpdate and ASPxClientComboBox.EndUpdate methods. Then, set them at the beginning and end of the setData method.

Finally, add a condition to check if the input value length is more than the minFilterLength variable and add timeout to allow a user to input the entire text and then show obtained items. Handle the client-side ASPxClientTokenBox.TokensChanged event and remove all items from the drop-down window.
Note: item highlighting will not work.

See also:
How to bind ASPxTokenBox to a large data source

Question Comments

Added By: Wayne Hammons at: 3/10/2017 6:14:24 AM    It states in the description that I can set AllowCustomTokens property but when I change it to false then it clears the text box as I type.  I have tried commenting out all the clearItems functions but it is not working.  What do I need to do to set AllowCustomTokens = false without breaking the token box function?

How to bind ASPxTokenBox to a large data source

$
0
0

This example demonstrates how to bind ASPxTokenBox to a large data source using WebMethods on the client side.
Create the GetFilteredData method that should return a list of items based on a string filter parameter. Then, handle the client-side ASPxClientTokentBox KeyUp event and execute the GetFilteredData method.
Create the setData method on the client side. After that, remove items that were added earlier and add new items to the TokenBox item collection in the setData method. Note that for certain purposes, it is possible to disable adding custom tokens using the AllowCustomTokens property and set the IncrementalFilteringDelay property to 800.
To reduce the server overload by avoiding unnecessary requests, it is recommended to add the ASPxClientComboBox.BeginUpdate and ASPxClientComboBox.EndUpdate methods. Then, set them at the beginning and end of the keyUp event handler.
Finally, add a condition to check if the input value length is more than the minFilterLength variable and add timeout to allow a user to input the entire text and then show obtained items. Handle the client-side ASPxClientTokenBox.TokensChanged event and remove all items from the drop-down window.
Note: item highlighting will not work.

See also:
How to bind TokenBox to a large data source

How to dynamically add and remove controls within ASPxCallbackPanel on callbacks

$
0
0

This example demonstrates how you can dynamically add and remove controls within an ASPxCallbackPanel on callbacks. In this case, a ViewState is not applied so it should be disabled (the EnableViewState property is set to false). A hierarchy of controls, which have been created on callbacks, should be recreated on Page.Init event.


In this example, tabs with custom content can be dynamically added to an ASPxPageControl on callbacks. In order to recreate a hierarchy of dynamically created controls (within tab pages) the tab information is saved to a Session object.


Additionally, the example demonstrates the usage of ASPxPageControl.TabTemplate property to specify a tab text and a close button.

Question Comments

Added By: Mark Germishuys at: 2/3/2016 1:37:06 AM    still removes previously created tabsAdded By: Artem (DevExpress Support) at: 2/3/2016 3:55:33 AM    

Hello Mark,

To process your post more efficiently, I created a separate ticket on your behalf: T341626: E4113 works incorrectly. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.

Added By: Attila Móricz at: 3/11/2017 8:03:28 AM    How can I access the html content of the ASPxHtmlEditor inside the tab on the server side?

How to implement a custom authorization service

$
0
0

This example illustrates how to restrict access to specific reports and documents based on an ASP.NET session, making documents available only to users that generated them.

To do this, register an OperationLogger object implementing the IWebDocumentViewerAuthorizationService interface and is inherited from the base WebDocumentViewerOperationLogger class.


How to color dashboard item elements in the ASP.NET Dashboard Control

$
0
0
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.

How to pass a hidden dashboard parameter to a custom SQL query in the ASP.NET Dashboard Control

$
0
0

The following example shows how to filter a custom SQL query by changing a parameter value in the ASPxDashboard.CustomParameters event handler.

In this example, the custIDQueryParameter query parameter is included in a WHERE clause of a custom SQL query. The custIDQueryParameter parameter is also bound to the hidden custIDDashboardParameter dashboard parameter. The value of this parameter is changed at runtime by handling the ASPxDashboard.CustomParameters event which is raised before the ASPxDashboard sends a query to a database.

How to check whether the series with the different view types are compatible

$
0
0

This example illustrate how to check compatibility of the series with the different view types at runtime. Basically, types of the series to be combined should use the same Diagram
type. So, to check whether series types are compatible, you can simply compare their Diagram types. To accomplish this task, create a new ChartControl instance when the series of the desired type is created, and then compare whether it has the same diagram type as an existing one.

How to use XPO in ASP.NET MVC application (Razor)

$
0
0

This example demonstrates how to create a simple ASP.NET MVC application using XPO as Data Access Layer. The solution used in this example is explained in paragraph #2 of the How to use XPO in an ASP.NET MVC application Knowledge Base article.

The approach to connect XPO to the database used in this example is described in detail in the following Knowledge Base article: How to use XPO in an ASP.NET (Web) application.

To separate the business logic from the object persistence layer, Views are bound to special classes inherited from the BaseViewModel<T> class declared in the example. These classes describe the View's model and implement the automatic synchronization of values changed by the user with underlying business objects. The synchronization is implemented in the overridden abstract GetData method. This is the place where you can convert data from the View's structure to the structure of your business objects mapped to corresponding tables in the database. In this method, you can access the XPO Session object and use its methods (such as GetObjectByKey, FindObject, delete or create persistent objects, if necessary). For example:

[C#]
usingSystem.Collections.Generic;publicclassOrderViewModel:BaseViewModel<Order>{publicstringName{get;set;}publicintCustomer{get;set;}publicoverridevoidGetData(Ordermodel){model.Name=Name;model.Customer=model.Session.GetObjectByKey<Customer>(Customer);}}

To load persistent objects from the database and transform them into View's models, we suggest using the LINQ to XPO feature. It will allow you to filter, sort, group data on the server side and easily convert loaded objects into an appropriate structure. For example:

[C#]
OrdersViewModelGetOrders(){returnnewOrdersViewModel(){Source=(fromoinXpoSession.Query<Order>().ToList()selectnewOrderViewModel(){ID=o.Oid,Name=o.Name,Customer=o.Customer.Oid}).ToList(),CustomersLookUpData=(fromcinXpoSession.Query<Customer>().ToList()selectnewCustomerViewModel(){ID=c.Oid,Name=c.Name}).ToList()};}

Note that LINQ to XPO is not the only approach you can use here. Refer to the following article to learn more about different approaches to query data using the XPO Session: Querying a Data Store.

For your convenience, we suggest that you inherit your controllers from the BaseXpoController<T> class declared in this example. This controller encapsulates the object persistence logic and allows you to save changes by calling its Save and Delete methods.

See also:
XPO Best Practices
XPO Getting Started
What is ViewModel in MVC?

Question Comments

Added By: TPS Programmer at: 11/3/2014 2:38:52 AM    

how to convert this syntaks

@model IEnumerable<CustomerViewModel>
@Html.Partial("IndexPartial", Model);

into vb syntax ?

Added By: TPS Programmer at: 11/3/2014 2:40:10 AM    

almost forget, because in VB source code, index.cshtml still in C#, not in VBHTML

Added By: Anthony (DevExpress Support) at: 11/3/2014 5:01:27 AM    

Hi,

The code would be as follows:

[VB.NET]
@ModelType IEnumerable(Of CustomerViewModel) @Html.Partial("IndexPartial", Model)

As for the example, we will correct the syntax as soon as possible.

Added By: Ken Byington 1 at: 5/26/2015 11:16:52 AM    

It sure would be nice if you would upgrade your examples to the current version of MircoSoft and DevExpress products.  When I tried to run the Example from here in VS 2013 using MVC 4, it had to convert to the current version and then I had to play with references and I finally ended up with this stack dump:
System.TypeInitializationException was unhandled by user code
 HResult=-2146233036
 Message=The type initializer for 'XpoHelper' threw an exception.
 Source=DevExpressMvcApplication
 TypeName=XpoHelper
 StackTrace:
      at XpoHelper.GetNewUnitOfWork()
      at DevExpressMvcApplication.Controllers.BaseXpoController`1.CreateSession() in c:\Visual Studios\DevExpressMvcApplication\Controllers\BaseXpoController.cs:line 18
      at DevExpressMvcApplication.Controllers.BaseXpoController`1..ctor() in c:\Visual Studios\DevExpressMvcApplication\Controllers\BaseXpoController.cs:line 10
      at DevExpressMvcApplication.Controllers.CustomersController..ctor()
 InnerException: DevExpress.Xpo.DB.Exceptions.UnableToOpenDatabaseException
      HResult=-2146233088
      Message=Unable to open database. Connection string: 'data source=.;initial catalog=XPOMVXExampleEditable;integrated security=sspi;'; Error: 'System.Data.SqlClient.SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) ---> System.ComponentModel.Win32Exception (0x80004005): The system cannot find the file specified
  at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
  at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
  at System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, Boolean withFailover, SqlAuthenticationMethod authType)
  at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, Boolean withFailover)
  at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString connectionOptions, SqlCredential credential, TimeoutTimer timeout)
  at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(TimeoutTimer timeout, SqlConnectionString connectionOptions, SqlCredential credential, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance)
  at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, DbConnectionPool pool, String accessToken)
  at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)
  at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup, DbConnectionOptions userOptions)
  at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
  at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
  at System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
  at System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry)
  at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)
  at System.Data.SqlClient.SqlConnection.Open()
  at DevExpress.Xpo.DB.MSSqlConnectionProvider.CreateDataBase(SqlConnection conn)
ClientConnectionId:00000000-0000-0000-0000-000000000000
Error Number:2,State:0,Class:20'
      Source=DevExpress.Xpo.v14.2
      StackTrace:
           at DevExpress.Xpo.DB.MSSqlConnectionProvider.CreateDataBase(SqlConnection conn)
           at DevExpress.Xpo.DB.MSSqlConnectionProvider.CreateDataBase()
           at DevExpress.Xpo.DB.ConnectionProviderSql..ctor(IDbConnection connection, AutoCreateOption autoCreateOption)
           at DevExpress.Xpo.DB.MSSqlConnectionProvider..ctor(IDbConnection connection, AutoCreateOption autoCreateOption)
           at DevExpress.Xpo.DB.MSSqlConnectionProvider.CreateProviderFromString(String connectionString, AutoCreateOption autoCreateOption, IDisposable[]& objectsToDisposeOnDisconnect)
           at DevExpress.Xpo.DB.DataStoreBase.QueryDataStore(String providerType, String connectionString, AutoCreateOption defaultAutoCreateOption, IDisposable[]& objectsToDisposeOnDisconnect)
           at DevExpress.Xpo.XpoDefault.GetConnectionProvider(String connectionString, AutoCreateOption defaultAutoCreateOption, IDisposable[]& objectsToDisposeOnDisconnect)
           at DevExpress.Xpo.XpoDefault.GetDataLayer(String connectionString, XPDictionary dictionary, AutoCreateOption defaultAutoCreateOption, IDisposable[]& objectsToDisposeOnDisconnect)
           at DevExpress.Xpo.XpoDefault.GetDataLayer(String connectionString, AutoCreateOption defaultAutoCreateOption)
           at XpoHelper.UpdateDatabase() in c:\Visual Studios\DevExpressMvcApplication\Helpers\XpoHelper.cs:line 48
           at XpoHelper..cctor() in c:\Visual Studios\DevExpressMvcApplication\Helpers\XpoHelper.cs:line 12
      InnerException: System.Data.SqlClient.SqlException
           HResult=-2146232060
           Message=A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
           Source=.Net SqlClient Data Provider
           ErrorCode=-2146232060
           Class=20
           LineNumber=0
           Number=2
           Server=""
           State=0
           StackTrace:
                at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
                at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
                at System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, Boolean withFailover, SqlAuthenticationMethod authType)
                at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, Boolean withFailover)
                at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString connectionOptions, SqlCredential credential, TimeoutTimer timeout)
                at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(TimeoutTimer timeout, SqlConnectionString connectionOptions, SqlCredential credential, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance)
                at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, DbConnectionPool pool, String accessToken)
                at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)
                at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup, DbConnectionOptions userOptions)
                at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
                at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
                at System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
                at System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry)
                at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)
                at System.Data.SqlClient.SqlConnection.Open()
                at DevExpress.Xpo.DB.MSSqlConnectionProvider.CreateDataBase(SqlConnection conn)
           InnerException: System.ComponentModel.Win32Exception
                HResult=-2147467259
                Message=The system cannot find the file specified
                ErrorCode=-2147467259
                NativeErrorCode=2
                InnerException:

Can you post an already migrated version so I don't have to waste more hours?

Added By: Anthony (DevExpress Support) at: 5/29/2015 3:34:37 AM    Hi Larry,

Thank you for bringing our attention to this. We will update the sample soon.

ASPxTokenBox - How to add a tooltip and change the background color of a token

Viewing all 7205 articles
Browse latest View live


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