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

How to clone a persistent object

$
0
0

Scenario

In this example, we create a CloneIXPSimpleObjectHelper class that will be used to clone the provided persistent object. 

Steps to implement

1. Implement the CloneIXPSimpleObjectHelper class as shown in the CloneIXPSimpleObjectHelper.xx file. This class uses persistent object metadata to create a copy of the provided persistent object. 
The Clone method has several constructors that allow you to specify the target Session and determine whether object synchronization is required or not. If the synchronize parameter is set to true, reference properties are only cloned if the reference object does not exist in the target Session. Otherwise, the existing object will be reused and synchronized with the source. Set this property to false if the target Session does not contain an object of the source.

2. Create a Form that will use the ListBox control to display the result of creating and cloning persistent objects. See the code of the Form class in the Form1.xx file.


As a result, the following output will be shown:



See also:
How to get a list of a persistent object's properties
Should I use XPO to transfer data between databases?

Question Comments

Added By: Sigurd Decroos at: 1/8/2013 5:48:41 PM    

There's a little catch with this code. Primary Keys are changed, so it doesn't make a real clone, but a copy. You have to change the code a bit so the primary key gets synced too if needed.

Added By: Mr292 at: 2/16/2013 12:45:27 PM    

I refactored some in order to replicate to different databases as well as to different assemblies in the other database. I came about this requirement because I wanted to remodel my DOM and did not want to have to manually do a lot of data imports.

    public class CloneIXPSimpleObjectHelper
    {
        /// <summary>
        /// A dictionary containing objects from the source session as key and objects from the
        /// target session as values
        /// </summary>
        /// <returns></returns>
        Dictionary<object, object> clonedObjects;
        Session sourceSession;
        UnitOfWork targetSession;

        /// <summary>
        /// Initializes a new instance of the CloneIXPSimpleObjectHelper class.
        /// </summary>
        public CloneIXPSimpleObjectHelper(Session source, UnitOfWork target)
        {
            clonedObjects = new Dictionary<object, object>();
            sourceSession = source;
            targetSession = target;
        }

        /// <summary>
        /// Initializes a new instance of the CloneIXPSimpleObjectHelper class to Clone to Different DB.
        /// </summary>
        public CloneIXPSimpleObjectHelper(Session session, string connstring)
        {
            UnitOfWork NewUOW = new UnitOfWork(
                XpoDefault.GetDataLayer(connstring, DevExpress.Xpo.DB.AutoCreateOption.SchemaAlreadyExists));

            clonedObjects = new Dictionary<object, object>();
            sourceSession = session;
            targetSession = NewUOW;
        }

        /// <summary>
        /// Initializes a new instance of the CloneIXPSimpleObjectHelper class to Clone to Different Assembly / DB.
        /// </summary>
        public CloneIXPSimpleObjectHelper(Session session, string connstring, System.Reflection.Assembly assembly)
        {

            var dict = new ReflectionDictionary();
            foreach (var item in assembly.GetTypes())
            {
                    if (item.IsSubclassOf(typeof(XPBaseObject)))
                        dict.CollectClassInfos(item);
            }
    
            UnitOfWork NewUOW = new UnitOfWork(
                XpoDefault.GetDataLayer(connstring, dict,
                DevExpress.Xpo.DB.AutoCreateOption.SchemaAlreadyExists));

            clonedObjects = new Dictionary<object, object>();
            sourceSession = session;
            targetSession = NewUOW;

        }

        public void Commit()
        {
            targetSession.CommitTransaction();
           
        }

        public T Clone<T>(T source) where T : IXPSimpleObject
        {
            return Clone<T>(source, targetSession, CloneMethod.IgnoreIfExistsInDesitnation);
        }
        public T Clone<T>(T source, CloneMethod sync) where T : IXPSimpleObject
        {
            return (T)Clone(source as IXPSimpleObject, targetSession, sync);
        }

        public object Clone(IXPSimpleObject source)
        {
            return Clone(source, targetSession, CloneMethod.IgnoreIfExistsInDesitnation);
        }
        public object Clone(IXPSimpleObject source, CloneMethod sync)
        {
            return Clone(source as IXPSimpleObject, targetSession, sync);
        }
        public object Clone(IXPSimpleObject source, Session targetSession, CloneMethod sync)
        {
            return Clone(source as IXPSimpleObject, targetSession, sync);
        }
        public T Clone<T>(T source, UnitOfWork targetSession, CloneMethod sync) where T : IXPSimpleObject
        {
            return (T)Clone(source as IXPSimpleObject, targetSession, sync);
        }
        public object Clone(XPBaseObject obj, Type targetType, CloneMethod sync)
        {
            return Clone(obj, targetSession, targetSession.GetClassInfo(targetType), sync);
        }

        public enum CloneMethod
        {
            TransferOnly,
            Synchronize,
            IgnoreIfExistsInDesitnation
        }
     /// <summary>
        /// Clones and / or synchronizes the given IXPSimpleObject.
        /// </summary>
        /// <param name="source"></param>
        /// <param name="targetSession"></param>
        /// <param name="synchronize">If set to true, reference properties are only cloned in case
        /// the reference object does not exist in the targetsession. Otherwise the exising object will be
        /// reused and synchronized with the source. Set this property to false when knowing at forehand
        /// that the targetSession will not contain any of the objects of the source.</param>
        /// <returns></returns>
        public object Clone(IXPSimpleObject source, UnitOfWork parentSession, XPClassInfo cloneClassInfo, CloneMethod sync)
        {
            if (source == null)
                return null;

            object sourceKey = source.Session.GetKeyValue(source);

            if (clonedObjects.ContainsKey(source))
                return parentSession.GetObjectByKey(cloneClassInfo,cloneClassInfo.KeyProperty.GetValue(clonedObjects[source]));

            
            NestedUnitOfWork nestedSession = parentSession.BeginNestedUnitOfWork();
            IXPSimpleObject clone = null;

            if (sync != CloneMethod.TransferOnly)
            {
                clone = (IXPSimpleObject)nestedSession.GetObjectByKey(cloneClassInfo, sourceKey);
                if (clone != null)
                {
                    if (sync == CloneMethod.IgnoreIfExistsInDesitnation)
                    {
                        clonedObjects.Add(source, clone);
                        return nestedSession.GetParentObject(clone);
                    }
                }
            }

            if (clone == null)
                clone = (IXPSimpleObject)cloneClassInfo.CreateNewObject(nestedSession);
      
            clonedObjects.Add(source, clone);

            try
            {
                XPClassInfo sourceClassInfo = source.Session.GetClassInfo(source.GetType());
                if (sourceClassInfo.KeyProperty.GetType() == cloneClassInfo.KeyProperty.GetType())
                    cloneClassInfo.KeyProperty.SetValue(clone, sourceKey);

                foreach (XPMemberInfo cloneMember in cloneClassInfo.PersistentProperties)
                {
                    XPMemberInfo sourceMem = sourceClassInfo.GetMember(cloneMember.Name);

                    if (sourceMem == null
                        || cloneMember is DevExpress.Xpo.Metadata.Helpers.ServiceField
                        || cloneMember.IsKey)
                        continue;

                    object val = null;
   
                    if (cloneMember.ReferenceType != null)
                    {
                        object createdByClone = cloneMember.GetValue(clone);
                        if (createdByClone != null)
                        {
                           
                            val = Clone((IXPSimpleObject)sourceMem.GetValue(source),
                                nestedSession,
                                nestedSession.GetClassInfo(cloneMember.MemberType),
                                sync==CloneMethod.TransferOnly?CloneMethod.Synchronize:sync);
                        }
                        else
                            if ((cloneMember.IsAggregated)
                                //REMOVE Below LINE IF YOU WANT TO MAINTAIN ONLY ONE WAY AGGREGATIOn
                                || (cloneMember.IsAssociation
                                    && cloneMember.GetAssociatedMember().IsAggregated)
                                )
                            {
                                val = Clone((IXPSimpleObject)sourceMem.GetValue(source), nestedSession,
                                       nestedSession.GetClassInfo(cloneMember.MemberType), sync);
                            }

                    }
                    else
                    {
                            val = sourceMem.GetValue(source);
                    }

                    if ((val != null) && !(val is DateTime && (DateTime)val == DateTime.MinValue))
                        cloneMember.SetValue(clone, val);
                }

                foreach (XPMemberInfo m in cloneClassInfo.CollectionProperties)
                {
                    if (m.HasAttribute(typeof(AggregatedAttribute)))
                    {
                        XPBaseCollection col = (XPBaseCollection)m.GetValue(clone);
                        XPBaseCollection colSource = (XPBaseCollection)sourceClassInfo.GetMember(m.Name).GetValue(source);

                        foreach (IXPSimpleObject obj in new ArrayList(colSource))
                        {
                            XPClassInfo targetinfo = col.GetObjectClassInfo();
                            col.BaseAdd(
                                Clone(obj, nestedSession,
                                    targetinfo, sync));
                        }
                    }
                }

                nestedSession.CommitTransaction(); //
                clonedObjects[source]= clone;
                return nestedSession.GetParentObject(clone);
            }
            catch
            {
                if (nestedSession.InTransaction)
                    nestedSession.RollbackTransaction();
            }

            return null;
        }

    
    
    }

Added By: Chris D at: 8/4/2015 9:56:17 AM    

Dear,

I face a real problem with your clonehelper. After implementing we recoginized that this helper will not only clone my recordset, it will also clone/create my relations.

So, for example i have a order management where i want to clone one order. But what happened is that the order will be cloned, but the underlying addresses (relation via keys) will be cloned, too. So, after cloning 10 orders, i have 10 times the same address in my address-masterdata ?

Any idea ?

Added By: Chris D at: 8/4/2015 10:50:22 AM    

To avoid creating the underlying record, i changed

If m.ReferenceType IsNot Nothing And NONEW=1 Then....

where NONEW=0.

Could you please have a short look if this is the right solution ?

Added By: Alexey (DevExpress Support) at: 8/4/2015 11:14:43 PM    Hello Chris,
Yes, it is possible to comment this part of code to disable creating of additional records.

How to calculate a weighted average function

$
0
0

This example demonstrates how to calculate a weighted average function. To do this, create a calculated field and in its expression, refer to two data fields and separate them using a special sign (such as "|").

Then, create a summary label bound to this calculated field with a custom summary function defined. Handle the label's SummaryGetResult event to parse the calculated field's value and calculate a weighted average function.

Question Comments

Added By: Abdul Shareef1 at: 3/12/2013 3:13:38 PM    

Can you please explain me how to do the following step for two numeric fields?

To do this, create a calculated field and in its expression, refer to two data fields and separate them using a special sign (such as "|").

Added By: George (DevExpress) at: 3/14/2013 5:50:49 AM    

Please open this project in Visual Studio, and in the Field List panel, right-click the "fieldWeight" calculated field. In the invoked popup menu, select "Edit Expression...", which runs the field Expression editor. In this editor, you can view the following expression: ToStr([UnitPrice] * [UnitsInStock]) + '|' + ToStr([UnitPrice])

Added By: Farukh Sharipov at: 6/14/2013 4:09:28 PM    

Can you explain more how to do two numeric fields? Maybe attach screencast?

How to create fully custom Role, User, Event, Resource classes for use with the Security and Scheduler modules

$
0
0

This example demonstrates how to create fully custom classes for use in our Security Module (with the 'old' DevExpress.ExpressApp.Security.SecurityComplex component) and Schedule Module.
Here is the Activity class, which is an analog of our standard Event class. It is used to represent appointments in the Scheduler Control.
The Employee is an analog of the standard User class. The Group class is an analog of our standard Role class. Two last classes are used as base classes to organize Complex Security Strategy for your application.
Take special note that in addition to security purposes, the Employee class supports the IResource interface, and this allows us to use objects of this class as resources in our custom "appointment" class.
I have also implemented two popular filtering tasks here: filtering appointments by the current logged employee and also filtering resources to show only those owned by the current logged employee.

IMPORTANT NOTES
1. When you implement this solution in your project, do not forget to turn on custom security classes by setting the RoleType and UserType properties for the SecurityComplex component within the Application Designer.
2. The filtering appointments and resources (plus sorting of resources) is provided by the SchedulerActivityListViewControllerBase class and its descendants. Please take special note that these controllers filter resources as follows:
   a. Administrator account (Sam, to log on, leave the Password field empty) sees all the resources and appointments in the root scheduler view.
   b. Non-Administrator account (John, to log on, leave the Password field empty) sees only his own resources and appointments in the root scheduler view.
   c. Both Administrator and Non-Administrator accounts see their own resources and appointments in the nested scheduler view.

3. You can use these controllers for study purposes, since they demonstrate the most common filtering scenarios in the scheduler view. If you do not need all this specific functionality, remove these controllers and create your own ones (perhaps based on the provided example code) that will do only your specific task. For example, the controllers from this example are not suitable in the nested scheduler view because you miss some part of the default Link/Unlink functionality since the scheduler view is always filtered to show only its own resources and appointments.That may not be desired because you may want to have the capability to link appointments from other resources, but they won't be shown due to the above. Plus, these demo controllers are unnecessary for appointments filtering in the nested scheduler view, because by default, in this view only appointments from the current resources are shown.
4. Example implementations are NOT designed for the 'new' security system components and scenarios (e.g., middle-tier application server or SecuredObjectSpaceProvider). To use the SecurityStrategyComplex component, provide fully custom implementations of the user and role classes as per the eXpressApp Framework > Task-Based Help > How to: Implement a Custom Security System User Based on an Existing Business Class article.

See Also:
Security System Overview
Scheduler Module Overview

Question Comments

Added By: Ad de Rijke at: 5/19/2014 4:52:28 AM    

The Web project does not compile: 'The type or namespace name 'WinWebSolutionAspNetApplication' could not be found (are you missing a using directive or an assembly reference?)'

Added By: Dennis (DevExpress Support) at: 5/20/2014 3:31:16 AM    @Ad: For some reason the WebApplication.cs file was emptied. I have attached a working sample for your reference. I will also update this example as well.

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

$
0
0
It is a frequent situation when a developer must include several field values in a hyperlink shown in CardView 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) In a simple case, the href parameter of the <a> element is defined by the KeyValue of the processed card.
2) In a complex case, the href parameter of the <a> element is defined in the server side GetCardValue method.

How to manage users (register a new user, restore a password, etc.) from the logon form in ASP.NET

$
0
0

Scenario
This example contains a reusable Security.Extensions module that provides a possible solution for the following scenarios:

Security - provide the capability to register a new user from the logon form
Security.Authentication - provide a "Forgot Password" feature

Refer to the following video to see the module features in action: http://www.screencast.com/t/h2goGEdZJc

Steps to implement

In order to use this module in your project, do the following:

1. Include the module sources into your solution and rebuild it;

2. Invoke the Module Designer for your platform-agnostic module and drag and drop the SecurityExtensionsModule from the Toolbox;

3. Add the following code into your platform-agnostic module class:

[C#]
staticYourPlatformAgnosticModuleName(){SecurityExtensionsModule.CreateSecuritySystemUser=Updater.CreateUser;}

where 'Updater.CreateUser' is your custom method that matches the following definition:

[C#]
publicdelegateIAuthenticationStandardUserCreateSecuritySystemUser(IObjectSpaceobjectSpace,stringuserName,stringemail,stringpassword,boolisAdministrator);

 

IMPORTANT NOTE
This module is currently ASP.NET only.

Question Comments

Added By: Daniele Bonetti at: 8/27/2012 3:14:19 PM    

downloaded and run the demo but i receive "Object reference not set to an instance of an object" error
xaf 12.1.5

Added By: octavia at: 9/24/2012 12:03:14 AM    

It can't be run. Object reference not set to an instance of an object" error

Added By: Santiago Moscoso at: 11/12/2012 3:39:21 PM    

On windows needs to invoke "EnsureShowViewStrategy" method from application, it's protected so you must use reflection.

On web I have problems with the action buttons not refreshing properly, must presh F5 to update buttons. (I'm working on 11.2.11)

Added By: Evgeniy Meyke at: 11/26/2012 4:59:41 AM    

Dennis, any chance to have this checked out soon?

   //Dennis: TODO
            //A possible issue in the framework - Controllers from ShowViewParameters are not added to the current Frame on the Web.
            //e.ShowViewParameters.Controllers.Add(CreateDialogController());

Added By: drew.. at: 3/9/2013 1:16:29 PM    

quick question before i begin integrating this: referring to the comment above " Include the module sources into your solution and rebuild it;" .. are you referring to the modules as listed below, or ALL the xaf modules?

Added By: drew.. at: 3/11/2013 10:12:45 AM    

.. for the benefit of others, this reference to "module" in #1 above, means to drop the entire Security.Extensions folder from the demo into your current solution that you want to update with the basic feature. Then add a reference from your platform-agnostic module (PAM) to the added project, rebuild, THEN go into the module designer for the PAM and drag-n-drop your newly added security module into the required modules section. Then rebuild again.

Added By: drew.. at: 3/11/2013 10:31:40 AM    

btw, i am in the process of integrating this with my DC-only based project. Once i have all the conversions done and tested i will likely post the project to help others save time.

Added By: Mario Blatarić at: 3/12/2013 1:59:10 AM    

Which parts make this module ASP.NET only? I don't understand what needs to be changed in order to make this work in WinForms as well. Any hints?

Added By: John01 at: 4/16/2013 8:10:38 AM    

Hi

When I run the example and click OK on register user I get the error 'Property 'Email' does not exist within type 'DevExpress.ExpressApp.Security.Strategy.SecuritySystemUser'.' on line user.SetMemberValue("Email", email) in function CreateUser. The email value is 'sam@example.com'. I did upgrade the project to 12.2.7 before running though. Any ideas?

Thanks

Regards

Added By: CArlos segura_1 at: 6/13/2013 1:22:53 PM    

someone has been to implement this?

Added By: Tony Tadros at: 9/5/2013 11:51:37 PM    

Hello Devexpress ,

having problem for some time downloading your examples
was thinking something wrong with my pc but tried some other still the same thing

ICAP Error (icap_error)

  
 An error occurred while performing an ICAP operation: Maximum file size exceeded; File: GetExample; Sub File: ManageUsersOnLogon.Module\BusinessObjects\ReadMe.txt; Vendor: Kaspersky Labs; Engine error code: 0x00000000; Engine version: 8.1.8.79; Pattern version: 130905.225000.10967985; Pattern date: 2013.09.05 22:50:00
 There could be a network problem, the ICAP service may be misconfigured, or the ICAP server may have reported an error.

 For assistance, contact your network support team.

Added By: Apostolis Bekiaris (DevExpress) at: 9/19/2013 3:35:30 AM    

Implemented in eXpandFramework 13.1.7.1
http://apobekiaris.blogspot.gr/2013/09/how-to-manage-users-register-new-user.html

Added By: Daniele M at: 7/26/2015 3:21:28 AM    

I would like to add a capctha code in this registration page.
how can i do? is there an example?
thanks

Added By: Dennis (DevExpress Support) at: 7/27/2015 2:46:05 AM    

@Daniele: While we do not have a ready E4037 example modification for this particular scenario, you can find the following ASP.NET documentation and reference tickets helpful:
ASPxCaptcha Overview
How to Validate a Captcha On Logon Screen
ASPxCaptcha in login page
How to: Use Custom Logon Parameters and Authentication

Should you experience any implementation difficulties, submit a separate ticket and attach your test project showing what you tried to implement according to this information.

How to: Access the Navigation Dock Panel (in a WinForms application)

Validation - How to highlight invalid properties when the View is shown

$
0
0

This example demonstrates, how to check rules when the View is activated, or the View's object is changed. For that purpose, the ImmediateValidationController is implemented. To avoid checking these rules when the business object is saved or deleted, their context is set to Custom.

Question Comments

Added By: Robert Emslie 1 at: 6/6/2014 6:00:21 AM    

This controller causes serious performance issues where validation requires database reads for uniqueness etc.

Added By: Anatol (DevExpress Support) at: 6/9/2014 9:46:37 AM    

This behavior is expected, taking into account the ImmediateValidationController's implementation. It checks validation rules on each ObjectChanged event, and thus, if these rules require searching in the database, performance may be affected. To improve performance, do not check such rules on ObjectChanged. Either do not subscribe to the ObjectChanged event in ImmediateValidationController at all, or declare rules that should be checked on ObjectChanged in a different context, and only check this context in the ObjectChanged event handler.

Added By: Vekrasoft at: 8/5/2014 6:07:42 AM    

Hello,

Thanks for this example. I've implemented it and changed it to work with a different context.
We use the 'OnChanged' context to the rules and in this controller we call the ValidateAllTargets function with this context.
This works fine if a validation rule ContextIDs property is exactly set to 'OnChanged' but now we want to connect it to more than one context so changed this to 'Save, OnChanged'. This should work according your documentation. But after this change the rules are not checked anymore. When validating in the Save action, the rules are validated as expected.

Could you please help? Thanks.

Added By: Vekrasoft at: 8/5/2014 7:22:44 AM    

Hi, I looked into the source code and found out that we need to split the different contexts in the string with te ';' separator in stead of the ',' separator. My bad. Works now as expected. Thank you.

Added By: Anatol (DevExpress Support) at: 8/5/2014 7:36:17 AM    

I am happy to hear that you have found a solution. Please let me know if there is a documentation topic that contains incorrect information about the separator.

Added By: Hari Setyawan 2 at: 8/18/2015 12:09:46 AM    

I just implement this example together with audit trail. But I got an error on :

if (resultsHighlightController != null) {
               RuleSetValidationResult result = Validator.RuleSet.ValidateAllTargets(ObjectSpace, targets, DefaultContexts.Save);
               if (result.ValidationOutcome == ValidationOutcome.Error || result.ValidationOutcome == ValidationOutcome.Warning || result.ValidationOutcome == ValidationOutcome.Information) {
                   resultsHighlightController.HighlightResults(result);
               } else {
                   resultsHighlightController.ClearHighlighting();
               }
           }

And I solved, If modified with this code :

if (resultsHighlightController != null && targets != null)

Thanks,
Hari Setyawan

ASPxCardView - How to focus a newly inserted card

$
0
0
To focus a newly inserted card, it is necessary to know the keyValue of this card. You can get the value by handling the ASPxCardView.CardInserted event, which is raised after a new card has been added to the ASPxCardView data source.

Layout API - How to use LayoutIterator to traverse layout tree

$
0
0
This example illustrates the use of LayoutIterator to traverse the document layout tree.

Use Move Next and Move Prev buttons to navigate the layout.
Click within the document and subsequently click the Start Here button to set caret position as the starting point.
Select a range in the document and click Set Range to specify selection as working area for the iterator.
Click Start Over to reset navigation.
Use Iterator Options to specify a Level Limit that is the layout level at which the iterator stops and not go any deeper.
Information status bar displays the type of the current layout element.

How to use ExpandoObjects with GridControl

How to dynamically size an image to make it fit into the entire page client area

$
0
0
This example demonstrates how to dynamically change the report control (XRPictureBox) size to make it take the entire report client area and reflect the page changes made by an end-user. In fact, this example demonstrates how to properly handle dynamic page settings changes. See How to properly handle dynamic page settings changes for more information.

How to: Bind a Chart to Data

$
0
0

The following example demonstrates how to bind a chart to data provided by a ViewModel.

How to: Implement Custom Grouping

$
0
0

This example shows how to group rows using custom rules. When grouping by the 'Unit Price' column, the rows in this column that have values between 0 and 10 should be combined into a single group. Rows whose values fall between 10 and 20 should be combined into another group, etc.

GridControl - How to implement text search in an active filter

$
0
0

This example demonstrates how to create a GridControl descendant with a custom panel to provide search functionality. You can specify which columns should be shown in the custom filter panel.

ASPxTreeList - How to implement single node selection

$
0
0

This tutorial demonstrates how single node selection can be implemented. In this sample, parent node selection is disabled, and end-users are allowed to select only one leaf node within the ASPxTreeList control.

If you wish to have recursive selection enabled, it is necessary to additionally disable the ViewState by setting EnableViewState to False. You can find a sample in the ASPxTreeList - How to allow only one root node to be selected (Recursive = true) ticket.


How to implement SearchResultsView for the SchedulerControl (similar to ListView in Outlook) using SearchControl

$
0
0

This example demonstrates how to implement SearchResultsView in SchedulerControl by analogy with ListView in Outlook. ListView in Outlook appears when you search for an appointment and displays summary information regarding found entries. This view does not support the concept of a visible time interval; i.e, all found appointments should be shown. This view provides similar context menus and editor forms to manage appointments.


Please see the "Implementation Details" (click the corresponding link below this text) to learn more about technical aspects of this approach implementation.

How to Create a Checked ComboBox

RichEditControl Event Viewer

$
0
0
This demo utility helps exploring RichEditControl's events.

OBSOLETE - How to emulate LoadingPanel using PopupControl (the Razor engine)

$
0
0

This example illustrates how to emulate a modal LoadingPanel using a model PopupControl with a customized content. Handle any client-side event to show PopupControl. As a popup is a client-side control, it will be hidden automatically after a round-trip to the server.

Question Comments

Added By: Rabab Siblini at: 8/18/2015 11:29:52 PM    

this is exactly what I'm looking for..thank you

Custom sorting - how to exclude the first row from sorting

$
0
0

This example demonstrates how to handle the ASPxGridView.CustomColumnSort event to sort all rows except for the first visible row.

Question Comments

Added By: Milind Kadbane at: 8/18/2015 10:05:55 PM    

We had exactly the same requirement and using this example it worked properly till the devexpress version 13.1.7.0. We recently upgraded to version 14.1.11.0 of the devexpress. The same custom sort started giving random results. We fixed it by changing the following line "e.Result = (e.SortOrder == DevExpress.Data.ColumnSortOrder.Ascending ? -1 : 1".  Instead of -1 we assigned it to 0 :) after  some trial and error. No other change in any line. And it worked. Posted this as it might be helpful to anyone visiting this link.

Added By: Paul (DevExpress Support) at: 8/19/2015 1:16:38 AM    Hi,

It is weird, I've ran this example on the latest version (15.1.5) and everything works perfectly. I've created a separate ticket on your behalf to discuss this behavior and find out what is going on. Please refer to E2207 doesn't work in version 14.1.11
Viewing all 7205 articles
Browse latest View live


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