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

How to change the current NavigationPane behavior to make it look like "hamburger menu" from mobile applications

$
0
0

The "hamburger menu" is a popular menu control for modern mobile applications. We have NavigationPane whose layout looks similar to this "hamburger menu", but has several differences. So, this example demonstrates how to customize the current NavigationPane behavior to make it look like the mentioned menu for modern mobile applications.

Question Comments

Added By: Taradanov at: 4/13/2016 1:04:06 PM    Looks like I cannot place new button above of the page buttons - page buttons always have VisibleIndex initialized and it cannot be changed from code, so new added button is always at the bottom of the pane. Any solution?Added By: Alexey Z (DevExpress Support) at: 4/14/2016 1:26:30 AM    

Hello,

To process your recent post more effectively, I've created a separate ticket on your behalf (T367698: NavigationPane - How to change the current page's order). It has been placed in our processing queue and will be answered shortly.


Multiple selection using checkbox (web style)

$
0
0

From version 13.2, the GridView in the XtraGrid control provides a built-in checkbox column for multiple row selection.

This feature is demonstrated in the following example: How to use an unbound check box column to select grid rows. Additional information can be found in the following topic: Multiple Row Selection via Built-In Check Column


Projects attached to the current article target earlier versions of DevExpress controls, which did not provide the built-in checkbox column for multiple row selection.
These examples show how to manually add a check column to allow web-style multiple row selection. End-users can select/deselect rows, group rows or select/deselect all rows by clicking the column header. Changing a check box value does not initiate row editing. These examples are based on the A371 article.

Question Comments

Added By: Marc Roussel at: 10/11/2012 5:59:00 AM    

Hmmm how do I use this class ?

Added By: You Logic at: 10/16/2012 4:16:54 AM    

When I select a row via code, the check box is not checked. How can I do this!?

Added By: Piotr Christ at: 2/8/2013 4:13:11 AM    

I had the same problem as You Logic ! How select row (with checkbox) from code ?

Added By: (no info) at: 11/25/2013 2:23:24 PM    

While this is a very nice implementation there is a problem with the code. Because you have defined selection *in the CheckMarkSelection.cs" as an ArrayList it is next to impossible to get at any values contained within each of the actual selected rows from the grid. Let's say one needs to obtain two of the values within the row...one is a string and one is an integer...how do you get the values out? There are no extension methods associated with "selection" that would allow you to enumerate the data lets say using linq or even simply doing somethin like: DataRowView theRow = (DataRowView)this.selection.GetSelectedRow(i); What happens is there is a cast error that occurs due to the generic types within the ArrayList. Granted this is necessary as we have an unknown group of column objects and values. There needs to be a built in method to access the individual values in the selected rows from "selection". I have tried 12 different methods to extract them and still a Cast error occurs.

Added By: Dave Smith 6 at: 3/4/2016 2:15:24 AM    After implementing this class the column does not show, not sure what I'm doing wrong.

In the constructor of my form  I call  new GridCheckMarksSelection(gridViewSearchInventory);

and then in the form load i bind to my grid Added By: Sasha (DevExpress Support) at: 3/4/2016 6:20:43 AM    

Hello Dave,
I've created a separate ticket on your behalf: GridControl - The check box column is not shown when using a class from the E1271: Multiple selection using checkbox (web style) example .
We will update it shortly.

Added By: Jacobo Amselem at: 4/14/2016 3:35:49 AM    Hello
How can I modify View_Click() to invert group row selection when clicking the group checkbox ONLY?
Current implementation inverts selection when clicking anywhere in the group row.

Thank you Added By: Alisher (DevExpress Support) at: 4/14/2016 5:05:29 AM    

Hello,

I've created a separate ticket on your behalf (T367815: How to invert group row selection when clicking the group checkbox only?). It has been placed in our processing queue and will be answered shortly.

FlyoutPanel - How to navigate between buttons by using a keyboard

$
0
0
FlyoutPanel can show buttons if the FlyoutPanel.OptionsButtonPanel.ShowButtonPanel option is enabled. It is possible to click a button only by using the mouse. Sometimes, it is comfortable to highlight a particular button and navigate between the buttons by using a keyboard. This example illustrates how to implement this feature. To highlight the first button, press the ALT key. Once it is done, it is possible to navigate between buttons by using the arrow keys. 


How to create an effect of a banded TreeList

$
0
0

The current version of the TreeList doesn't support bands. This example demonstrates how you can merge column headers to create an effect of bands.

[OBSOLETE]
Starting with v14.2, TreeList supports bands out-of-the-box. See the Bands help topic.

Question Comments

Added By: (no info) at: 4/5/2013 3:46:56 PM    

Where is TreeListHeaderMerger method defined?

Added By: Sarath Kumar Munikrishnan at: 6/18/2015 12:31:16 AM    

HI I need to merge Columns also. Not the header. I used following code change in the below code

public class TreeListHeaderMerger
   {
       private TreeList treeList;
       private TreeListColumn columnToMerge;

       public TreeListHeaderMerger(TreeList treeList, TreeListColumn columnToMerge)
       {
           this.treeList = treeList;
           this.columnToMerge = columnToMerge;
           columnToMerge.OptionsColumn.AllowMove = false;
           GetNextColumn().OptionsColumn.AllowMove = false;
           treeList.CustomDrawColumnHeader += treeList_CustomDrawColumnHeader;
           treeList.CustomDrawNodeCell += treeList_CustomDrawNodeCell;
       }

       void treeList_CustomDrawNodeCell(object sender, CustomDrawNodeCellEventArgs e)
       {

           TreeListColumn nextColumn = GetNextColumn();
           if (nextColumn == null) return;
           if (e.Column == nextColumn) { e.Handled = true; return; }
           if (e.Column != columnToMerge) return;
           Rectangle r = e.ObjectArgs.Bounds;
           r.Width = r.Width + nextColumn.VisibleWidth;
           e.ObjectArgs.Bounds = r;
       }

       TreeListColumn GetNextColumn()
       {
           if (columnToMerge.VisibleIndex == treeList.Columns.Count - 1) return null;
           return treeList.Columns[columnToMerge.VisibleIndex + 1];
       }

       void treeList_CustomDrawColumnHeader(object sender, CustomDrawColumnHeaderEventArgs e)
       {
           TreeListColumn nextColumn = GetNextColumn();
           if (nextColumn == null) return;
           if (e.Column == nextColumn) { e.Handled = true; return; }
           if (e.Column != columnToMerge) return;
           Rectangle r = e.ObjectArgs.Bounds;
           r.Width = r.Width + nextColumn.VisibleWidth;
           e.ObjectArgs.Bounds = r;
       }
   }

But I can't able to merge columns Its hiding second column value but not the border. Once I clicking the specific field I'm able to view the data also. Am I missing any thing?

Added By: Alisher (DevExpress Support) at: 6/18/2015 1:03:34 AM    Hi,

I will reply you in the Merge two columns in treeList ticket. Please refer to it for further correspondence.

How to override the default skin image colorization algorithm

$
0
0
This example demonstrates how to implement a custom skin colorization algorithm using the approach described in this Knowledge Base article: How to override the default skin image colorization algorithm. The custom skin image colorizer implemented in this example can be used to substitute the specified color in all skin images with a custom color. For example, to change the color of the RibbonForm header in the Office 2016 Colorful skin.

GridView - A simple Batch Editing implementation

$
0
0

This example illustrates a simple implementation of a new ASPxGridView Batch Editing Mode functionality available starting with version 13.2:
ASP.NET WebForms & MVC: GridView Batch Edit (What's new in 13.2)

This example is a standalone DB-independent solution of the online Batch Editing demo. Refer to the demo's Description for more information.

Question Comments

Added By: Saitgalina Albina at: 3/30/2016 11:44:36 PM    Hello! I do the same in my project, but the data is not saved. In HomeController.cs batchValues.Insert.count = 0, batchValues.Update.Coumt = 0, batchValues.DeleteKey.column = 0 always coming.  What could be the reason? Added By: Mike (DevExpress Support) at: 3/31/2016 12:37:12 AM    

Hello,

To process your recent post more efficiently, I created a separate ticket on your behalf: T362286: GridView in Batch Edit Mode - Why BatchValue Count = 0 on Controller. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.

Added By: Carlton Guc at: 4/14/2016 6:59:20 AM    This is a great example.  I just have a couple of questions.  1.  The Save/Cancel Changes is outside the window.  How do I add Scroll bars to deal with that?  2.  Can I make my own button that does Save and Cancel?  3.  Can I make it automatically Save changes on a Callback or before I leave a page?Added By: Lanette (DevExpress Support) at: 4/14/2016 10:47:54 AM    

Hello,

To avoid discussing multiple topics in this thread, I have extracted your original inquiry to separate tickets created on your behalf:
T367990: GridView with a simple Batch Editing implementation - How to set scrollbars to see Save/Cancel Changes,
T367990: GridView with a simple Batch Editing implementation - How to set scrollbars to see Save/Cancel Changes,
T367991: GridView with a simple Batch Editing implementation - Automatically save changes on a callback or before leaving a page. For quick and efficient responses, we kindly request that future tickets cover one issue at a time. Your time and cooperation are appreciated.
These tickets have been placed in our processing queue and will be answered shortly.

How to obtain a dashboard item's client data in the WinForms Viewer

$
0
0

The following example demonstrates how to get client data corresponding to a particular visual element using DashboardViewer's API.
In this example, the DashboardViewer.DashboardItemClick event is handled to obtain client data for the Card dashboard item and display this data in a Chart control. We obtain axis points placed on the "Sparkline" axis for the clicked card, determine corresponding actual/target values, and save these values to a data table. This table is used as a data source for the Chart control. 
Note that you can apply master filtering by year in the Pie dashboard item. The chart will display client data according to the selected year.

See Also:
T359303: How to get data from a clicked dashboard item (WinForms)

ASPxGridView - How to programmatically change the column's filter in the FilterExpression

$
0
0

This example demonstrates how to achieve this task. The CriteriaColumnAffinityResolver.SplitByColumns method is used here to return the dictionary of criteria operators. It is possible to modify them as necessary. Please refer to the ASPxGridView - How to programmatically change the column's filter in the FilterExpression article for more information.

Question Comments

Added By: Christian King 1 at: 9/26/2014 6:40:26 AM    

How would you use a combo box to control filtering?

Added By: Paul (DevExpress Support) at: 9/26/2014 8:17:12 AM    

Hello,

To process your recent post more efficiently, I created a separate ticket on your behalf: T155279: E4641 - How to use a combo box to control filtering. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.

Added By: Sebastien Desmarais at: 4/14/2016 8:09:28 AM    Hi DevExpress,

Is it possible to update this example with the recommandations from "Make the BinaryOperatorType.Like operator obsolete"?

Thank you,

Sebastien
Added By: Vova (DevExpress Support) at: 4/15/2016 4:32:07 AM    

Hello Sebastien,

Thank you for pointing out this issue to us. I've updated this example according to the changes described in the "Make the BinaryOperatorType.Like operator obsolete" article. 

Best regards,
Vova


How to highlight the next or previous search result in the treelist

ASPxRichEdit - How to save and load documents from a database

$
0
0

This code example demonstrates how to save and restore ASPxRichEdit documents from a database using a Binary column.
Use the ASPxRichEdit.Open method to load a document and call the ASPxRichEdit.SaveCopy method to save changes.

It is also possible to handle the ASPxRichEdit.Saving event to save a document by clicking the ribbon's built-in Save button.

Question Comments

Added By: IS Dept at: 4/16/2016 12:00:03 PM    I get
Error 2 The type or namespace name 'Rtf' does not exist in the namespace 'DocumentFormat' (are you missing an assembly reference?) 

When trying to use this sample

How to establish association from one class to many classes

$
0
0

For instance, you have a class for File. This class will be used in more than one BO. Each BO would then have a listview of Files that are attached to the particular class.
To accomplish this, you can create a super class, say DomainObjectBase and then establish a one-to-many relationship between the File class. After that you can derive your BOs from the DomainObjectBase class and they will automatically get the parent's relationships.

Question Comments

Added By: Martin D. at: 6/21/2014 11:01:22 AM    

Is it possible - to also associate with different representations of "File" ?
So that DomainObject1 -> get's a collection of GetCollection<MyFile>("files")
and domainObject2 -> Get's a collection of GetCollection<PngFile>("files") ?

Added By: Dennis (DevExpress Support) at: 6/23/2014 6:15:09 AM    

I see several possible solutions for this:

1. Use the current code as is, create File descendants and then customize the New Action depending on the selected type to allow creation only of required file types. See also the How to display details collections with descendant classes filtered by object type in a DetailView  example for some example code on creating descendants and presenting them in the UI (this is not exactly what you are looking for, but it demonstrates a part of the described solution).
2. Do not have a common association and rather implement specific associations for each object and file type.

 

Added By: Paul Kubb at: 4/17/2016 8:48:18 AM    Association with abstract class?
are you sure this code is usable?

How to: Provide Data for TreeList Unbound Columns Using Event

How to add a custom summary item to the grid's footer menu

$
0
0

Sometimes it's necessary to specify a way of calculating summaries that is different from the default one. Assume you don't want to take into account cells with no data when calculating summaries. It's possible to accomplish this task using two events: use the GridView.CustomSummaryCalculate event to provide a custom summary and the GridView.PopupMenuShowingevent to add a corresponding item to the grid's footer menu.
See also:
Custom Aggregate Functions

Question Comments

Added By: Sir Kevin Heathfield at: 7/23/2013 3:49:25 AM    

Not a single code comment.. Nice..

Added By: Matteo Lazzari at: 6/5/2014 3:12:58 AM    

Why do you do:

foreach (DevExpress.Utils.Menu.DXMenuItem item in footerMenu.Items)
               item.Enabled = true;

I see this is necessary for enable the menu items... But I would like to maintain disabled the summarization items not available for a particular field type (for example, the sum for the strings). Is this possible?
Thank you.

Added By: Nikita (DevExpress Support) at: 6/6/2014 1:25:50 AM    

Hello,
Our grid inner logic disables all items in the summary popup menu when a custom summary is applied to the grid. We use this loop to overcome this behavior without creating a big hierarchy of derived controls. 
If you need to disable some items, you can create a structure that stores items that should be disabled not to enable these items in this loop. 
I hope this helps.

Added By: Matteo Lazzari at: 6/11/2014 6:23:13 AM    

Ok, thank you. Using a dictionary that stores the key "FieldName + the summary Caption" and the value of the enabled property I can maintain the original enabled property value, except for the "None" element that I test in this way:

If item.Tag.Equals(GridStringId.MenuFooterNone) Then ...

Now, I've got another issue. Since my grid is inside the XAF Framework the active summarization items are stored in the user model and when I load the grid they are already visible. But the CustomSummaryCalculate logic fails because the tag has not value.
What can I do?

Added By: Nikita (DevExpress Support) at: 6/12/2014 3:59:26 AM    

Hello,
Identification of a custom summary by tag is applicable for XAF, since it does not restore the SummaryItem.Tag property. If you have only one custom summary, you can simply remove a check of the CustomSummaryCalculate event handler. 
If you have a number of summaries, you need to save the currently applied summary name and restore it manually when necessary. 
I hope this helps.

Added By: Matteo Lazzari at: 11/19/2014 12:31:32 AM    

Thank you Nikita. How can I save the currently applied summary name and how to restore it?

Added By: Nikita (DevExpress Support) at: 11/19/2014 7:16:30 AM    

Hello,
 You can serialize the currently applied property in any manner that is convenient in the View.ModelSaved event handler and restore these settings in the View.ModelLoaded  event handler. 
I hope this helps. 

Added By: Simon Wallis at: 4/18/2016 9:58:21 AM    Could you please provide a zip download with source code? Our company doesn't give us Admin rights on our workstations, so I am unable to install the Example Runner. Thanks.Added By: Nikita (DevExpress Support) at: 4/18/2016 12:17:16 PM    

 Hello Simon,

Our samples are zip files. So you can change the file resolution to zip and  unpack the files. Please note that in this case you have to run the Project Converter against this project to make it work.

How to force the XtraTabControl to maintain the line order in MultiLine mode

$
0
0

When the XtraTabControl is used in MultiLine mode, it automatically moves the currently selected line to the last position. This example demonstrates how to change this behavior by registering custom paint styles.

Question Comments

Added By: Sathya Ramakrishnan at: 4/19/2016 3:09:36 AM    Neat ! just took the specific skin class and called the register. "MyTabStylesRegistrator.Register();" and commented the rest. works like charm. Thank you guys.

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. Download and include the Security.Extensions module project into your XAF solution (as per MSDN) and rebuild it. This custom module contains Application Model settings (Model.DesignedDiffs.xafml) to layout custom Actions next to the logon form input fields (see the How to: Include an Action to a Detail View Layout  article for more details) as well as non-persistent data models for parameter screens (LogonActionParameters.cs) and finally a ViewController (ManageUsersOnLogonController.cs) for the logon DetailView that declares custom Actions and their behavior. The controller is registered via the XafApplication.CreateCustomLogonWindowControllers event in the ModuleBase descendant (Module.cs) along with other service logic.

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.Added By: Daniele M at: 9/7/2015 7:31:28 AM    

is it possible to customize the logon form in order to obtain the logon button first of two rows with the button "forgot password" and "create a new user"?

Added By: Daniele M at: 9/7/2015 9:04:38 AM    

is it possible to change label to user name in register user form? I tried with displayname attribute in RegisterUserParameters,cs but it didn't work.
thanks

Added By: Dennis (DevExpress Support) at: 9/8/2015 2:43:16 AM    

@Daniele:
Both things are possible. The Security.Extensions module contains the Model.DesignedDiffs.xafml file with model customizations of the AuthenticationStandardLogonParameters_DetailView node. This node determines what your logon form will look like in the UI. You can customize its layout or change captions of items via the Model Editor designer. Should you experience any further customization difficulties here, please submit a separate ticket, and describe what you tried to do and what did not work as expected. Thanks.

Added By: Daniele M at: 9/25/2015 1:12:51 AM    

I can not integrate the example 3 with https://www.devexpress.com/Support/Center/Example/Details/E2849 to enforce password complexity.
can you help me?
thank you

Added By: Anatol (DevExpress Support) at: 9/25/2015 2:23:18 AM    

Hello Daniele,

To process your recent post more efficiently, I created a separate ticket on your behalf: T293660: How to integrate the E4037 and E2849 examples. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.

Added By: MohammedFarooq at: 10/9/2015 5:33:10 PM    

Hi Dennis & Anatol,

I have used the is example in my project and it works great.

could you please show how to add an image (mylogo.png for example) on the right top corner of the logon page? It is a png image to show company's logo on the logon page.

Added By: Dennis (DevExpress Support) at: 10/12/2015 3:58:10 AM    @MohammedFarooq:
I am happy to hear of your progress.
>> how to add an image (mylogo.png for example) on the right top corner of the logon page?

Would you please submit a separate ticket and attach a screenshot of the desired UI, because possible solutions will vary a lot based on the exact logo placement?

Added By: MohammedFarooq at: 10/12/2015 8:54:03 AM    

Hi Dennis,

I have created a separate ticket as suggested by you.

https://www.devexpress.com/Support/Center/Question/Details/T299424

Added By: Vishwas Mokashi at: 12/24/2015 3:42:16 AM    

Hello,

I want to implement User Registration in our solution.

<<

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;
>>

What are Module Sources ?  Module.cs?  LogonActionParameters.cs?, ManageUsersOnLogonController.cs? given in this ticket?
where and how to include it in solution?

Added By: Dennis (DevExpress Support) at: 12/24/2015 4:50:41 AM    @Vishwas: I have updated this instruction. Let me know in case of any further questions.Added By: Vishwas Mokashi at: 12/24/2015 6:21:21 AM    

Dennis, thanks I know how to include project but where from to down load?. Or I create new Module project and copy paste the code classes given in this ticket?

Added By: Dennis (DevExpress Support) at: 12/24/2015 6:31:24 AM    

@Vishwas: You can download complete example source code under the Downloads section at the right side of the example webpage. Let me know if you experience any further difficulties here.

Added By: Vishwas Mokashi at: 12/24/2015 6:36:55 AM    

Thanks Dennis, I had done that but problem was I did not have the Sample Runner loaded on my machine and could not extract the files.

Thank you and Merry Christmas!!

Added By: Dennis (DevExpress Support) at: 12/24/2015 7:02:23 AM    @Vishwas: Am I correct that you have now installed the Example Runner and could download this example? If so,  I am happy to hear of your results.
Merry Xmas to you and yours too!Added By: Vishwas Mokashi at: 12/24/2015 7:14:39 AM    

Yes Dennis, I have Sample Runner, could download it and use it also. Thanks...

Added By: Dennis (DevExpress Support) at: 12/24/2015 7:33:15 AM    @@Vishwas: Great!

How to use the ShowCaret/HideCaret functions with the TextEdit

$
0
0

This example demonstrates how to use the ShowCaret and HideCaret functions of the user32.dll with the TextEdit control and its descendants.

Question Comments

Added By: Dimitris Trivizakis at: 4/19/2016 4:46:14 AM    I'm using the exact same code for a ButtonEdit instance (which is a descendant) but i can't get the editor's cursor to blink when it is not focused.
Isn't that the purpose of  ShowCaret? Or maybe I'm missing something
Added By: Alisher (DevExpress Support) at: 4/19/2016 4:48:05 AM    

Hello,

I've created a separate ticket on your behalf (T369368: How to use the ShowCaret/HideCaret functions with the TextEdit). It has been placed in our processing queue and will be answered shortly.

How to copy a cell's value to other cells by dragging its right bottom edge

$
0
0

This example demonstrates how to provide the capability to copy cell values like this is done in MS Excel. In this example, when a cell is selected, you can see a small black rectangle at the bottom. If you drag this rectangle and extend GridView's selection, all selected cells will have the same value as that of a source cell.

Question Comments

Added By: Alex Vignola at: 4/19/2016 7:25:12 AM    Hi, first i'd like to report an error in one of the version of your code, and also a little addition.

In the v2010 vol1.4 - v2011 vol1.4 sample... In the SelectedCellsBorderHelper class, in the GetCellRect function, GetGridCellInfo should receive column.AbsoluteIndex and not column.VisibleIndex

Also if you want to handle non editable columns, one would need to modify two things
[VB.NET]
PrivateSub CopyCellsValues()Dim value AsObject = View.GetRowCellValue(SourceGridCell.RowHandle, SourceGridCell.Column)Dim selectedCells() As GridCell = View.GetSelectedCells()ForEach cell As GridCell In selectedCellsIf cell.Column.OptionsColumn.AllowEdit AndAlsoNot cell.Column.OptionsColumn.ReadOnlyThen View.SetRowCellValue(cell.RowHandle, cell.Column, value)EndIfNext cellEndSub

[VB.NET]
PrivateFunction GetSelectionBounds() As RectangleDim width AsInteger = 0Dim height AsInteger = 0Dim rTop As Rectangle = Rectangle.EmptyDim shouldReturn AsBoolean = FalseDim view As GridView = TryCast(GridControl.FocusedView, GridView)Dim info As GridViewInfo = TryCast(view.GetViewInfo(), GridViewInfo)Dim gridCells() As GridCell = view.GetSelectedCells()If gridCells.Length = 0 Then shouldReturn = TrueReturn Rectangle.EmptyEndIfDim hb As Brush = Brushes.BlackDim visibleColl AsNew List(Of GridCellInfo)()ForEach row As GridRowInfo In info.RowsInfoDim coll As GridCellInfoCollection = (TryCast(row, GridDataRowInfo)).CellsForEach cell As GridCellInfo In coll visibleColl.Add(cell)Next cellNext rowDim collection AsNew List(Of GridCellInfo)()ForEach cell As GridCell In gridCellsForEach cellInfo As GridCellInfo In visibleCollIf cellInfo.RowInfo IsNot NothingAndAlso cellInfo.ColumnInfo IsNot NothingThenIf cell.RowHandle = cellInfo.RowHandle AndAlso cell.Column.Equals(cellInfo.Column) AndAlsoNot cell.Column.OptionsColumn.ReadOnlyAndAlso cell.Column.OptionsColumn.AllowEdit Then collection.Add(cellInfo)EndIfEndIfNext cellInfoNext cellIf collection.Count = 0 Then shouldReturn = TrueReturn Rectangle.EmptyEndIf rTop = GetCellRect(view, collection(0).RowHandle, collection(0).Column)Dim rBottom As Rectangle = GetCellRect(view, collection(collection.Count - 1).RowHandle, collection(collection.Count - 1).Column)If rTop.Y > rBottom.Y Then height = rTop.Y - rBottom.BottomElse height = rBottom.Bottom - rTop.YEndIfIf rTop.X <= rBottom.X Then width = rBottom.Right - rTop.XElse width = rTop.X - rBottom.RightEndIfReturnNew Rectangle(rTop.X, rTop.Y, width, height)EndFunction


Added By: Stas (DevExpress Support) at: 4/20/2016 4:30:31 AM    Hello,
To address your question, I've created a separate Update the E2621 example ticket. Please refer to it for further discussion.

How to implement the Drag&Drop functionality for the CardView

$
0
0

We have created an example demonstrating how to implement the Drag&Drop functionality for the CardView.

This functionality is encapsulated in the CardDragDropManager class. So, all you need to do is to attach this behavior to the GridControl.

Question Comments

Added By: A Dev at: 10/24/2014 12:19:57 PM    

Where to find the DragDropManagerBase class?

Added By: Ivan (DevExpress Support) at: 10/24/2014 12:47:27 PM    

You can find this class in the C:\Program Files (x86)\<DevExpress folder>\Components\Sources\DevExpress.Xpf.Grid\DevExpress.Xpf.Grid.Extensions\DragDrop\DragDropManager\DragDropManagerBase.cs file. Note that this file will be installed regardless your subscription type. It's available for trial users as well.

GridView - How to correct the column layout if column widths are set in percentages and the grid is grouped

$
0
0
This example illustrates the solution for the first issue described at ASPxGridView - Why column layout may become broken after user actions if certain column widths are set in percentages
The main idea is to determine the widest column and delete its width setting. As a result, the widest column will fill the space that appears after moving one of the columns to the Group panel. 
For this, we implemented the GridViewColumnHelper class and use Session  to preserve information about column width between requests to the server.

How to sort a ASPxPivotGrid by clicking on a field value

$
0
0

The PivotGrid allows sorting by any column. To do this, right click any field value and select an appropriate field to sort by it. Sometimes it is possible to sort by any column by simply clicking on it. This example shows how to implement this behavior. You should create a template for field values to place a hyperlink (or a button) rather than a plain text.

[C#]
ASPxPivotGrid1.FieldValueTemplate=newFieldValueTemplate(ASPxPivotGrid1);

The FieldValueTemplate class should implement the ITemplate interface. We've replaced standard contents of a field value in the InstantiateIn method.

[C#]
publicclassFieldValueTemplate:ITemplate{   publicFieldValueTemplate(ASPxPivotGridpivotGrid){       this.pivotGrid=pivotGrid;   }   ASPxPivotGridpivotGrid;   protectedASPxPivotGridPivotGrid{get{returnpivotGrid;}}   #regionITemplateMembers   publicvoidInstantiateIn(Controlcontainer){       PivotGridFieldValueTemplateContainerc=(PivotGridFieldValueTemplateContainer)container;       HyperLinklink=newHyperLink();       link.Text=(string)c.Text;       link.NavigateUrl="#";       link.Attributes["onclick"]=GetOnClickHandler(c);       c.Controls.Add(link);       boolisSortedByColumn=GetIsSortedByColumn(c);       if(isSortedByColumn){           c.Controls.Add(newLiteralControl("&nbsp;*"));       }   }   boolGetIsSortedByColumn(PivotGridFieldValueTemplateContainerc){       List<PivotGridFieldPair>sortedFields=PivotGrid.Data.VisualItems.GetSortedBySummaryFields(c.ValueItem.IsColumn,c.ValueItem.Index);       boolisSortedByColumn=sortedFields!=null&&sortedFields.Count> 0;       returnisSortedByColumn;   }   stringGetOnClickHandler(PivotGridFieldValueTemplateContainerc){       StringBuilderres=newStringBuilder();       res.Append(pivotGrid.ClientInstanceName).Append(".PerformCallback('SC|");       res.Append(GetFieldIndex(c)).Append("|")           .Append(c.ValueItem.IsColumn).Append("|")           .Append(c.ValueItem.VisibleIndex).Append("|")           .Append(c.ValueItem.DataIndex);       res.Append("');");       returnres.ToString();   }   intGetFieldIndex(PivotGridFieldValueTemplateContainerc){       returnc.ValueItem.Field!=null?c.ValueItem.Field.Index:-1;   }   #endregion}

The GetOnClickHandler method returns a javascript code that will perform a ASPxPivotGrid's callback passing all required parameters to the server. On the server side, you should handle the CustomCallback event handler and apply sorting to it.

[C#]
   protectedvoidASPxPivotGrid1_CustomCallback(objectsender,PivotGridCustomCallbackEventArgse){       string[]args=e.Parameters.Split('|');       if(args[0]=="SC")           HandleSortByColumnClick((ASPxPivotGrid)sender,args);   }   voidHandleSortByColumnClick(ASPxPivotGridpivotGrid,string[]args){       intfieldIndex=int.Parse(args[1]),           visibleIndex=int.Parse(args[3]),           dataIndex=int.Parse(args[4]);       boolisColumn=bool.Parse(args[2]);       PivotAreaarea=GetArea(isColumn),           crossArea=GetCrossArea(isColumn);       PivotGridFielddataField;       List<PivotGridField>fields;       List<object>values;       GetFieldsAndValues(pivotGrid,fieldIndex,visibleIndex,dataIndex,area,           outdataField,outfields,outvalues);              SetSortByColumn(pivotGrid,crossArea,dataField,fields,values);   }

Sorting can be set by filling the SortBySummaryInfo structure. The BeginUpdate/EndUpdate method calls are necessary to prevent multiple data recalculations.

[C#]
   voidSetSortByColumn(ASPxPivotGridpivotGrid,PivotAreacrossArea,PivotGridFielddataField,List<PivotGridField>fields,List<object>values){       pivotGrid.BeginUpdate();       List<PivotGridField>crossFields=pivotGrid.GetFieldsByArea(crossArea);       for(inti= 0;i<crossFields.Count;i++){           crossFields[i].SortBySummaryInfo.Field=dataField;           crossFields[i].SortBySummaryInfo.Conditions.Clear();           for(intj= 0;j<values.Count;j++){               crossFields[i].SortBySummaryInfo.Conditions.Add(                   newPivotGridFieldSortCondition(fields[j],values[j]));           }       }       pivotGrid.EndUpdate();   }
Question Comments

Added By: conservation at: 12/23/2012 7:09:38 PM    

I did it but i don't see the view pane of pivotGrid change anything. Could you please show me how to sort as the sort way that pivotgrid used when right click in header row or column and choose Sort "xxxx" by this Column/row ....
Just some necessary functions that i can use to sort pivotgrid view pane.
Thanks

Added By: Deepika K at: 11/11/2014 4:27:37 AM    

This code didn't work for me

Added By: Maxim (DevExpress Support) at: 11/11/2014 5:52:47 AM    

Hello Deepika,
I have created a separate thread for your inquiry. 
The E1439 example does not work properly
I will answer you as soon as possible. 

Viewing all 7205 articles
Browse latest View live


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