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

How to create a AdvBandedGridView descendant class and register it for design-time use

$
0
0

This is an example of a custom AdvBandedGridView and a custom control that inherits the DevExpress.XtraGrid.GridControl. Make sure to build the project prior to opening Form1 in the designer.

To obtain general information about creating and registering a custom view descendant class at design time, refer to the following Knowledge Base article: How to create a GridView descendant class and register it for design-time use.


DXTreeList - How to implement summary footers

$
0
0

At the moment, our TreeListView does not provide the capability to show summary footers for its groups. This example demonstrates how to implement this functionality manually by using a custom DataRowTemplate.

This workaround has a few limitations:
1. It supports only a two-level structure.
2. The context menu for summary footers is not supported.
3. The grid's horizontal scrolling is not supported.

How to create a CardView descendant class and register it for design-time use

$
0
0

This is an example of a custom CardView and a custom control that inherits the DevExpress.XtraGrid.GridControl. Make sure to build the project prior to opening Form1 in the designer.

To obtain general information about creating and registering a custom view descendant class at design time, refer to the following Knowledge Base article: How to create a GridView descendant class and register it for design-time use.

How to create a LayoutView descendant class and register it for design-time use

$
0
0

This is an example of a custom LayoutView and a custom control that inherits the DevExpress.XtraGrid.GridControl. Make sure to build the project prior to opening Form1 in the designer.

To obtain general information about creating and registering a custom view descendant class at design time, refer to the following Knowledge Base article: How to create a GridView descendant class and register it for design-time use.

How to create a WinExplorerView descendant class and register it for design-time use

$
0
0

This is an example of a custom WinExplorerView and a custom control that inherits the DevExpress.XtraGrid.GridControl. Make sure to build the project prior to opening Form1 in the designer.

To obtain general information about creating and registering a custom view descendant class at design time, refer to the following Knowledge Base article: How to create a GridView descendant class and register it for design-time use.

How to use Criteria Property Editors

$
0
0

This example illustrates the specifics of using Criteria Property Editors in an XAF application. The complete description is available in the How to: Use Criteria Property Editors help topic.

See Also:
How to dynamic change the ObjectType Criteria Property Editors

Question Comments

Added By: Marco Castro at: 6/25/2014 5:24:38 AM    

Hello,

The idea is great but the most usefull fielter don't work. This filter, as example, can be created but when executed don't work because a popup window that should appear so the user can fill the desired name is not poped up.

Contains([FirstName], ?)

Thanks,
Marco Castro

Implementing a context menu with "Select / Unselect All In Group" functionality

$
0
0

In this sample, the client-side ContextMenu event is used to show the ASPxPopupMenu above the grid's group rows. The menu contains two items: "Select all in group" and "Unselect all in group". When the end-user clicks these items, a custom callback is executed. In the grid's CustomCallback event handler necessary actions are performed to select / unselect all rows that belong to the group row on which the context menu has been invoked.

Question Comments

Added By: Dhaval.Shah at: 6/24/2014 8:33:12 PM    

Hello,
This example will not work when a group is collapsed and "Select" menu item is clicked.
In that case, the detail rows are not selected when we expand the group.
If you could please review and advice.
Thanks.

Added By: Artem (DevExpress Support) at: 6/25/2014 6:02:43 AM    

Hello Dhaval,

I moved your inquiry to a separate thread created on your behalf: 
ASPxGridView - How to select/unselect hidden rows of a particular group
Please refer to it for further correspondence. 

How to show a hyper link (URL, email, etc.) for a business class property

$
0
0

Scenario
The following basic functionality is implemented in the HyperLinkPropertyEditor.Web and HyperLinkPropertyEditor.Win modules:

1. WinForms and ASP.NET PropertyEditor classes based on the HyperLinkEdit and ASPxHyperLink controls that can be used for representing object fields, containing email address or a URL in the UI.
2. To validate an input, a combined RexEx mask is used in both ListView and DetailView of Windows Forms and ASP.NET applications. The default regular expression is the following:
(((http|https|ftp)\://)?[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(:[a-zA-Z0-9]*)?/?([a-zA-Z0-9\-\._\?\,\'/\\\+&%\$#\=~])*)|([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,6})
You can use it as is or modify it per your specific needs. Look for Regular Expressions in MSDN for more information on how to do this.
3. The default email client or default browser window is opened after a single click on the hyper link if it represents a valid email or web address. For end-users convenience, in DetailView of Windows Forms projects, a double-click is necessary to be able to easily edit the field.



Steps to implement

1. Copy and include the HyperLinkPropertyEditor.Web and HyperLinkPropertyEditor.Win projects into your solution and make sure it is built successfully.

2. Invoke the Application Designer for the YourSolutionName/WinApplication.xx file by double-clicking it in Solution Explorer. Invoke the Toolbox (Alt+X+T) and then drag & drop the HyperLinkPropertyEditorWindowsFormsModule component into the modules list on the left.
3. Invoke the Application Designer for the YourSolutionName/WebApplication.xx file by double-clicking it in Solution Explorer. Invoke the Toolbox (Alt+X+T) and then drag & drop the HyperLinkPropertyEditorAspNetModule component into the modules list on the left.
4. Define a string persistent property within your business class and decorate it with the DevExpress.Persistent.Base.EditorAliasAttribute passing the "HyperLinkPropertyEditor" string as a parameter. See the E2096.Module\HyperLinkDemoObject.xx file for an example.

 

 

See Also:
PropertyEditor Class
Class HyperLinkEdit
Class ASPxHyperLink
Access Editor Settings
PropertyEditors.HyperLink - Introduce the capability to show/edit a string which represents an URL or "e-mail" (DetailView/ListView and WinForms/ASP.NET)


How to bind the ImageComboBoxEdit to a datasource

$
0
0

This example demonstrates how the GridLookUpEdit can be customized to look like the ImageComboBoxEdit. This approach allows you to implement the data-bound ImageComboBox editor.

Question Comments

Added By: Lars Wuckel HHK at: 6/25/2014 1:04:44 AM    

I get an exception if I press a key for searching a item:

  bei DevExpress.XtraEditors.GridLookUpEdit.FindUpdatePopupSelectedItem(Int32 itemIndex)
  bei DevExpress.XtraEditors.PopupBaseAutoSearchEdit.ProcessFindItem(KeyPressHelper helper, Char pressedKey)
  bei DevExpress.XtraEditors.PopupBaseAutoSearchEdit.ProcessAutoSearchChar(KeyPressEventArgs e)
  bei DevExpress.XtraEditors.GridLookUpEdit.ProcessAutoSearchCharCore(KeyPressEventArgs e)
  bei DevExpress.XtraEditors.Popup.PopupGridLookUpEditForm.ProcessKeyPress(KeyPressEventArgs e)
  bei DevExpress.XtraEditors.Popup.SimplePopupBaseForm.OnKeyPress(KeyPressEventArgs e)
  bei System.Windows.Forms.Control.ProcessKeyEventArgs(Message& m)
  bei System.Windows.Forms.Form.ProcessKeyPreview(Message& m)
  bei System.Windows.Forms.Control.ProcessKeyMessage(Message& m)
  bei System.Windows.Forms.Control.WmKeyChar(Message& m)
  bei System.Windows.Forms.Control.WndProc(Message& m)
  bei DevExpress.XtraEditors.Container.EditorContainer.WndProc(Message& m)
  bei DevExpress.XtraGrid.GridControl.WndProc(Message& m)
  bei System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
  bei System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
  bei System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
  bei System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
  bei System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
  bei WindowsApplication1.Program.Main() in c:\Users\lwuckel\Documents\Samples\XtraEditors Library\14.1.4\E2200\K18394\WindowsApplication1\Program.cs:Zeile 27.
  bei System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
  bei Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
  bei System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
  bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
  bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
  bei System.Threading.ThreadHelper.ThreadStart()

Added By: Lars Wuckel HHK at: 6/25/2014 1:06:17 AM    

for this issue the popup has to be open while you typing

Added By: Svetlana (DevExpress Support) at: 6/25/2014 8:53:23 AM    Hi, 

I have extracted your inquiry to a separate ticket . Please refer to it. 

How to bind the XtraScheduler with multi-resource appointments to XPO

$
0
0

Problem:

How can I bind the XtraScheduler to eXpress Persistent Objects, if an Apppointment Storage contains multi-resource appointments (the AppointmentStorage.ResourceSharing property is set to true). I've already read KB aritcle #A2787 (How to bind the XtraScheduler to XPO), but it doesn't help much.

Solution:

To accomplish this task, perform the following steps:

1. Add the DevExpress.Xpo.vX.y.dll assembly to the references list of the project.

2. Declare XPAppointment and XPResource classes (derived from XPObject).

3. Rebuild the application, so that these objects can be used for the XPCollection.

4. Drop two XPCollection components from the toolbox onto a Form and name them xpCollectionAppointments and xpCollectionResources.

5. Set their ObjectClassInfo properties to the XPAppointment and XPResource objects, respectively.

6. Set the SchedulerStorage.Appointments.DataSource property to xpCollectionAppointments, and the SchedulerStorage.Resources.DataSource property to xpCollectionResources.

7. Specify all required mappings for the AppointmentStorage and the ResourceStorage.

8. Handle the SchedulerStorage.AppointmentsChanged and SchedulerStorage.AppointmentsInserted events using the event handler which calls the XPBaseObject.Save method. The event handler is the same for both events.

This approach is illustrated by the sample project.

How to generate row and cell styles using conditional expressions in WPF DXGrid

$
0
0

OBSOLETE. Starting from version 14.1, DXGrid introduces the built-in conditional formatting feature. See the Conditional Formatting article and the E983 - How to implement conditional formatting for rows ticket for details.

This example illustrates how to add the DXGrid behavior when you can use some conditional expressions and apply your custom style for cells and rows.

This functionality was implemented by an attached behavior for TableView which encapsulates all the functionality. In addition, this approach allows you to add new style options in XAML or in a code-behind file of your application.

We also added a new "Format Condition Editor" item to the column popup menu.

 
This item will show you a dialog window for adding new styles and deleting and editing existing styles.

Question Comments

Added By: Mark G Servidio at: 1/9/2013 6:26:06 PM    

Is there an example of this same functionality for Silverlight? We require an almost identical functionality for our users.

Added By: David Hsu 1 at: 10/14/2013 9:19:49 AM    

It was great to be able to customize appearance using expression. But I found the appearance didn't get updated when I check/uncheck "IsCompleted" field.

I added INotifyPropertyChanged to Task object. Also I switched to different row to make the data saved to underline data.

How to create a custom View allowing collapsing of band headers

$
0
0

This example demonstrates how to create a custom BandedGridView with custom BandedColumns. The columns now have the DefaultBandColumn property and the View draws buttons in band headers. On pressing this button columns in the band whose DefaultBandColumn option is disabled become hidden if they are visible and vise versa. Columns with DefaultBandColumn option enabled remain untouched. Such behavior is achieved by processing the CustomDrawBandHeader event in combination with MouseMove, MouseDown and MouseUp events in a BandedGridView descendant. Also we need to create a BandedColumn descendant in order to have the DefaultBandColumn property.

Question Comments

Added By: Andrzej Bukalski at: 6/26/2014 5:36:07 AM    

Hi,

this is very nice functionality, but I am having a problem when I have some columns InVisible but added to the Band.

In this situation it simply reverse visible to invisible without collapsing

The same situation is when you drag a Column to Collapsed Band

Regards
Andrzej

How to: Use FocusBehavior

$
0
0
This example demonstrates how to use the FocusBehavior.

How to: Use ConfirmationBehavior

$
0
0
This example demonstrates how to use the ConfirmationBehavior.

How to: Use DependencyPropertyBehavior

$
0
0
This example demonstrates how to use the DependencyPropertyBehavior.

How to: Use ValidationErrorsHostBehavior

$
0
0
This example demonstrates how to use the ValidationErrorsHostBehavior.

Scaffolding Wizards - How to create a custom filter

$
0
0

This example demonstrates how to create a custom filter. For more information, refer to the corresponding help topic.

Scaffolding Wizards - How to add a new detail collection

$
0
0

This example demonstrates how to add a new detail collection to an existing project.. For more information, refer to the corresponding help topic.

dxDataGrid - How to utilize CRUD operations using the context menu

$
0
0
This example demonstrates how to implement a context menu for editing, adding and deleting rows of dxDataGrid.

How to implement select/unselect for all rows in a group row

$
0
0

This example demonstrates how to implement select/unselect for all rows in a group row.

It's possible to implement this behavior only by using ASPXGridView 9.1. For more information, please refer to Add client- and server-side methods to obtain rows belonging to a certain group.

First, place ASPxCheckBox and ASPxLabel into the Grid.Templates.GroupRowContent template.

Second, set the ASPxCheckBox.Checked property and the client-side ASPxCheckBox.ClientSideEvents.CheckedChanged event in the ASPxGridView.HtmlRowPrepared event handler.

In this example the ASPxLabel.Text is bound in the markup using Two-Way DataBinding.

Question Comments

Added By: Brian Dukes 2 at: 7/15/2013 8:39:14 AM    

I'm looking to do this exact thing in the latest 13.1.5 ASP.NET MVC controls -- How can this be done?

Added By: Gustavo Becerril at: 6/27/2014 4:38:28 PM    

This example doesn't take into account grouping by more than one field, it merely selects the first item of every subgroup. I'd love to find out if there's a not-so resource intensive way to select every item inside every subgroup.

Viewing all 7205 articles
Browse latest View live


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