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

WinForms Spreadsheet Pivot Table API

$
0
0
This example demonstrates how to use the SpreadsheetControl Pivot Table API to create and modify pivot tables in code.
The application includes the RichEditControl (at the top) used to display and edit the code and the SpreadsheetControl (at the bottom) which shows the result of code execution.
You can modify the code and watch the result. If an error occurs during compilation or execution, the code window background color turns to pink.

Starting from v2016 vol.1:
- Create calculated fields and calculated items
- Group items in a PivotTable field
- Sort items in a PivotTable field by values of a data field

WPF Spreadsheet Pivot Table API

$
0
0
This example demonstrates how to use the SpreadsheetControl Pivot Table API to create and modify pivot tables in code.
The application includes the RichEditControl (at the top) used to display and edit the code and the SpreadsheetControl (at the bottom) which shows the result of code execution.
You can modify the code and watch the result. If an error occurs during compilation or execution, the code window background color turns to pink.

Starting from v2016 vol.1:
- Create calculated fields and calculated items
- Group items in a PivotTable field
- Sort items in a PivotTable field by values of a data field

How to access the DocumentManager, BarManager and RibbonControl

How to use custom graph layout algorithms to arrange shapes in DiagramControl

$
0
0
DiagramControl provides two methods that make it easier to use external graph layout algorithms to arrange diagram shapes. The GraphOperations.GetDiagramGraph method reads the diagram currently loaded into DiagramControl and returns the Graph object that contains collections of edges and nodes represented by diagram items. You can use this information to calculate positions for diagram shapes. Then, for every shape, create the PositionInfoobject containing the shape reference and its position. To apply the layout to the loaded diagram, call the DiagramControl.RelayoutDiagramItems method that accepts the collection of PositionInfo objects.

This example demonstrates how the GetDiagramGraph and RelayoutDiagramItems methods can be used to connect the Microsoft Automatic Graph Layout library to DiagramControl.

How to localize WinFroms Scheduler UI with the Localizer class descendant

How to: Create a DiagramShape Descendant with Editable and Serializable Properties

$
0
0
This example demonstrates how to serialize custom data using DiagramControl's serialization mechanism. In the example, the Content property of diagram shapes is loaded from data objects every time the diagram is shown. To associate shapes with data objects, the DatabaseObjectID property is added at the DiagramShape descendant level. To serialize this property along with standard DiagramShape properties, perform the following steps:

1) Mark your custom property with the XtraSerializableProperty attribute:
[C#]
[XtraSerializableProperty]publicintDatabaseObjectID{get;set;}


2) Call the ItemTypeRegistrator.Register method to register your custom shape type for serialization:

[C#]
DiagramControl.ItemTypeRegistrator.Register(typeof(DiagramShapeEx));

Note:
In certain scenarios, it is easier to use the DiagramShape.Tag property to store custom data without creating DiagramShape descendants. In this case, no further steps are needed as the Tag property is serialized by default.

To edit your custom property in PropertyGridControl, create a DiagramShapeController descendant and override the GetEditablePropertiesCore method. In this method, add your property to a collection of editable properties:

[C#]
protectedoverrideIEnumerable<PropertyDescriptor>GetEditablePropertiesCore(){varownerType=typeof(DiagramShapeEx);returnbase.GetEditablePropertiesCore().Concat(new[]{DependencyPropertyDescriptor.FromProperty(DiagramShapeEx.DescriptionProperty,ownerType),});}

How to use custom graph layout algorithms to arrange shapes in DiagramControl

$
0
0
DiagramControl provides two methods that make it easier to use external graph layout algorithms to arrange diagram shapes. The GraphOperations.GetDiagramGraph method reads the diagram currently loaded into DiagramControl and returns the Graph object that contains collections of edges and nodes represented by diagram items. You can use this information to calculate positions for diagram shapes. Then, for every shape, create the PositionInfoobject containing the shape reference and its position. To apply the layout to the loaded diagram, call the DiagramControl.RelayoutDiagramItems method that accepts the collection of PositionInfo objects.

This example demonstrates how the GetDiagramGraph and RelayoutDiagramItems methods can be used to connect the Microsoft Automatic Graph Layout library to DiagramControl.

How to: Create Items with Custom Content in DiagramControl

$
0
0

Simple shapes in DiagramControl display only their content as an editable string. If it's necessary to add custom elements to diagram items, use the DiagramContentItem class. DiagramContentItem has the ContentTemplate property, which can be used to put any elements into the item.

[XAML]
<Stylex:Key="calendarContentItem"TargetType="dxdiag:DiagramContentItem"><SetterProperty="ContentTemplate"><Setter.Value><DataTemplate> ...</DataTemplate></Setter.Value></Setter></Style>

To register DiagramContentItem in the toolbox, use the DiagramStencil.RegisterTool method with FactoryItemTool as a parameter:

[C#]
stencil.RegisterTool(newFactoryItemTool("Calendar",()=>"Calendar",diagram=>newDiagramContentItem(){CustomStyleId="calendarContentItem",ConnectionPoints=newDiagramPointCollection(new[]{newPoint(0.05, 0.5),newPoint(0.95, 0.55)})},newSize(200, 200),true));

After that, register the stencil using DiagramToolboxRegistrator.RegisterStencil.
Please note that to properly deserialize DiagramContentItem, it's necessary to set its CustomStyleId property, which accepts a key of a Style applied to the item.


How to save dashboards created in ASPxDashboardDesigner to a DataSet

How to group tree list columns in bands in the same manner as in AdvancedGridView

$
0
0

This feature is available out-of-the-box starting from version 14.2. See TreeList - Implement bands in a manner similar to the one provided in AdvBandedGridView

For earlier versions:

This example demonstrates how to create a custom tree list with the capability to create bands in the same manner as in AdvancedGridView.
Note that this is not a full implementation of bands in TreeList but just an example of how it can be done. Some features like Drag&Drop of bands and Column Chooser are disabled because of differences in TreeList layout calculation algorithm which does not support bands.

Question Comments

Added By: Afrizal Chen at: 6/4/2012 1:40:17 AM    

I set the left most column in this example to be "FixedLeft", the column is still overriden by the next columns when left-scrolled . Please help.

Added By: Afrizal Chen at: 6/26/2012 11:38:38 PM    

I wanted to override the PrintInfo just like "http://www.devexpress.com/Support/Center/p/E2667.aspx" but the TreeList class doesn't have the override method like "CreatePrintInfoInstance()"

Added By: (no info) at: 4/4/2013 10:22:57 AM    

Is this not possible with v2011 2.8?

Added By: Vasily (DevExpress Support) at: 4/4/2013 10:47:52 AM    

Hi David,

I have extracted your question to a separate ticket created on your behalf: Q373313 (How to group tree list columns in bands in the same manner as in AdvancedGridView).

Added By: anh lam at: 5/28/2013 9:12:32 PM    

in this demo if a column is not belong to any band, it's will not display on treelist at runtime. How can i do to slove this issue ?

Added By: George Hebert (WSI) at: 10/3/2014 9:58:12 AM    

Can you please add proper support for this?  I noticed that the original request for this came 9 years ago (http://www.devexpress.com/scid=AS4236)...so when you said: "...if you need a full-functional solution, please wait when this feature is available out of the box", how much longer do we have to wait?

Added By: Demetrius (DevExpress Support) at: 10/3/2014 12:21:04 PM    

Hello, 

At this moment our developers are working on this feature. We have plans to release it in the near future. But, I cannot promise that it will happen in the upcoming version, 14.2. Stay turned and we will inform you when it happens.  

Added By: Mickael L at: 10/20/2014 2:09:53 AM    

Hi

I think there is a mistake in method MyTreeListBandCollection.Remove
Why is there a recursive -- and infinite -- call at the end of the method ?

Added By: Mickael L at: 10/20/2014 2:47:51 AM    

Same thing with MyTreeListViewInfo.FindFixedLeftColumn
Did you want to call base.FindFixedLeftColumn() actually ?

Added By: Mickael L at: 10/20/2014 3:35:01 AM    

In class MyTreeListBand, methods "TryToSwap" and "TryToSwapBandAndColumn" contains two unused local variables.
Is this intended ?

Added By: Mickael L at: 10/20/2014 3:40:38 AM    

Is there a way to make, at least, the functionalities of TreeList working at design time ?
Currently this user control display a blank rectangle at design time. We cannot see normal added column at design time
It's not a problem if I can not add banded column at design time (i will at runtime)
but I would like all design time feature of ancestor treelist working.
Is there a way ?

Added By: Dimitros (DevExpress Support) at: 10/20/2014 5:03:44 AM     Hello Mickael,

The current example just illustrates the main idea of how this feature can be implemented manually. This is not a complete feature and that's why it has a lot of limitations.
We are currently working on implementing the full bands support and hopefully it will be available in the near feature.

So, if this feature is not immediately needed for you, I suggest that you wait for the official bands support, which should be available in one of the next major releases.Added By: Mickael L at: 10/20/2014 7:21:29 AM    

Yeah ok but you said that 9 years ago (see George's comment) :o)

Do you have any schedule we could follow and on which we could take decision : (postpone some dev or not for example)
Here is a project that almost works : https://www.devexpress.com/Support/Center/Example/Details/E3581
I had open a new ticket to fix it : https://www.devexpress.com/Support/Center/Question/Details/T163213

Added By: Alisher (DevExpress Support) at: 10/20/2014 11:31:05 PM    

Hi Mikael,

Thank you for submitting a separate ticket. We will answer you there shortly. 

Custom form, custom fields and custom actions on reminder alert

$
0
0

The problem:

Here is what I want to do:

1) Create an appointment with custom fields and an alarm
2) Add an occurrence for that appointment with alarm as well
3) Prevent the alarm from showing and insert my own code for all occurrences
4) Being able to access the custom fields data for all occurrences
5) Dismiss the handled recurrent appointment

The solution:

Run the attached project. Click the "Create appointment with reminder" button. See the appointment series created at a current time of the day. The alert will be fired in 15 seconds by default. Before it happens, open the newly created today's appointment, change its "Price" value and save it. When the reminder is triggered, a new appointment is created with a Subject line informing of the changed value for the Price custom field.

How to Print and Export the Grid

$
0
0

This example shows how to preview and print/export the grid content. The grid is printed and exported using the built-in capabilities.

Question Comments

Added By: Mary Roy at: 6/25/2012 1:53:12 PM    

Using DevExpress 12.1.4.0 the print preview does not print the Is Private column correctly.
Either all the rows are checked or all the rows are unchecked on the preview which may not be what is displayed in the grid.

Added By: MasterRanger at: 6/24/2016 7:38:33 AM    In the line
DataContext = new IssueList();
How does DataContext know what it's pointed to?  Same question applies for the
view.ShowPrintPreviewDialog(this);
lines

How to obtain data on the ResponseCapabilities event

OBSOLETE - ASPxGridView - Cell Merging

$
0
0

UPDATED:

Starting with version v2016 vol 1 (v16.1), this functionality is available out of the box. Set the ASPxGridView.SettingsBehavior.AllowCellMerge / GridViewDataColumn.Settings.AllowCellMerge property to "true" to activate it. Please refer to the ASP.NET Grid - Cell Bands, Cell Merging, and Cell Focus - (Coming soon in v16.1) blog post and the Cell Merging demo for more information.
If you have version v16.1+ available, consider using the built-in functionality instead of the approach detailed below.


For Older Versions:

The example shows how to implement the cell merge feature for the ASPxGridView control.
You can use the helper class that will perform cell merging for the grouped grid as well.
Please keep in mind that functionality such as row selection, in-place editing and focused row may not work as expected which is understandable.

Question Comments

Added By: Seonkyeong Min at: 5/11/2015 2:23:37 PM    

Hello, This example is not working well.

First Line is complex.

other lines is works.

i wanna attach an image file.
but i cant upload the image because you guys doesn't have upload file function.

Added By: Larry (DevExpress Support) at: 5/12/2015 12:33:07 AM    

Hello,

To process your recent post more efficiently, I created a separate ticket on your behalf: T240441: ASPxGridView - Issue with a cell merging. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.

Added By: Jay Gamblin at: 5/29/2015 10:41:37 AM    

This does not appear to work with 14.2.5.  I get  'ASPxClientTableFixedColumnsHelper' is undefined

Added By: Anthony (DevExpress Support) at: 6/1/2015 4:28:57 AM    

Hello,

To process your recent post more efficiently, I created a separate ticket on your behalf: T249336: E970 - 'ASPxClientTableFixedColumnsHelper' is undefined. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.

Added By: Balmukund Shrivastav at: 7/13/2015 12:13:52 AM    

Thanks for the helper class. this functionality is working first time on the page load for ASPxGridView v12.1, but grid get distorted when we try to filter the records. Appreciate if you could provide some help.

Thank you,
Blamukund

Added By: Mike (DevExpress Support) at: 7/13/2015 12:18:28 AM    

Hello Blamukund,

To process your recent post more efficiently, I created a separate ticket on your behalf: T266070: E970 for version 12.1. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.

Added By: Ivo Michielsen 1 at: 9/22/2015 2:54:32 AM    

Unfortunately I get an error while trying to implement this class. I get the error 'The typename "Rendering" does not exist in the type "DevExpress.Web.ASPxGridView" '. The version used is 15.1.6

Added By: Larry (DevExpress Support) at: 9/22/2015 5:49:14 AM    Hello,

It seems that you have created a separate ticket for this issue. Let's continue discussing this issue in the ASPxGridView - Cell Merging thread.

Added By: Vyacheslav Emelianov at: 6/15/2016 9:26:33 AM    This does not appear to work with 15.2.9.0  I get  this.SetCellVisible is not a function, because the object "this" is Window in 
 
ChangeCellsVisibility: function(row, startIndex, endIndex, display) { 
  var visible = display !== "none";
  for(var i = startIndex; i <= endIndex; i++) {
   if(!row.cells[i])
    break;
   this.SetCellVisible(row.cells[i], visible);
  }
 },

Added By: Helen (DevExpress Support) at: 6/15/2016 11:46:50 AM    

Hello Vyacheslav,

I've created a separate ticket on your behalf (T392595: ASPxGridView - Cell Merging). It has been placed in our processing queue and will be answered shortly.

How to reorder dxDataGrid rows using drag-and-drop

$
0
0
This example demonstrates how to move dxDataGrid rows using Draggable and Droppable plug-ins of the jQueryUI library. 

To accomplish this task, we need to perform the following steps:

1. Set a fake CSS class ("myRow") to a data row. This will help us find all data rows using a jQuery selector and assign Draggable and Droppable plug-ins to the rows. Assign the key value of each row to a row element. We need to use the dxDataGrid.rowPrepared callback function for this step.
2. When the drop event fires, we need to get indexes of the dropped and the target rows, recalculate indexes according our requirements and save them to a data store.
3. Reload data by calling the dxDataGrid.refresh method.

See also:
ArrayStore.load
ArrayStore.byKey
ArrayStore.update
.data()
Question Comments

Added By: Frederico Lima at: 6/24/2016 3:56:10 PM    Update this tutorial. It does not work for the most current version. 

An example of usage extended Batch Editing API

ASPxGridView - How to implement cascading comboboxes in Batch Edit mode

$
0
0

Starting with v16.1, we started supporting the callback mode for GridViewComboBoxColumn and the EditItemTemplate implementation is not necessary. The main steps are:
1) Use the client-side ASPxClientGridView.BatchEditStartEditing event to check the main combo box value and update the child combo box data (if it's necessary).

2) Handle the SelectedIndexChanged event to send callbacks when a user changes a value in the main combo box.
3) Use an ASPxHiddenField to pass information about the last selected value in the main editor to the server. This step is necessary to update data on a custom callback and to be able to get the last selected value when filtering is performed.
4) Handle the ASPxClientComboBox.EndCallback event for the second editor to select an item after a custom callback.
 
The attached example illustrates how to implement all these steps (see BatchEditScript.js).

For earlier versions:

The concept of cascading combo boxes requires sending a callback to the server to get data for the second editor based on the first editor's selected value. 
In the meantime, it's impossible to send callbacks for built-in editors and it's necessary to use the EditItemTemplate (see ASPxGridView - Batch Edit - Support a scenario when GridViewComboBoxColumn is used in callback mode).
A basic scenario of this approach requires the following steps:
1) Use the client-side ASPxClientGridView.BatchEditStartEditing  and ASPxClientGridView.BatchEditEndEditing  events  to provide the template combo box with values.
2) Handle the SelectedIndexChanged event to send callbacks if it's required.
3) Handle the ASPxClientComboBox.EndCallback event for the second editor to apply the selected item after a callback.
4) Handle the ASPxClientGridView.Init  and ASPxClientGridView.EndCallback events  to initialize and reset global variables responsible for data providing logic after the grid was refreshed. 
 
See also: 
ASPxGridView - How to implement cascading combo boxes in Batch Edit mode by using WebMethods

Question Comments

Added By: umesh patel 1 at: 8/19/2014 11:34:15 PM    

Dear sir
Binding City Editor , if i have more then 400,000 cities need to be bind, Shall i used same binding concept of i used linqservermodedatasource for the binding to increase performance. Can you please send me sample project how can i use linqservermodedatasouce.  
Thanks for your time

Added By: Artem (DevExpress Support) at: 8/20/2014 6:41:34 AM    

Hello,

To process your recent post more efficiently, I created a separate ticket on your behalf: T142172: ASPxGridView - How to implement cascading comboboxes bound to a large data in Batch Edit mode . This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.

Added By: umesh patel 1 at: 8/20/2014 11:01:37 PM    

in CITY edittor inside GridViewDataComboBoxColumn , EditItemTemplate instead of ASPxComboBox i can use aspxlookup becuase i want to provide user to search item based on incremental search

Umesh

Added By: Artem (DevExpress Support) at: 8/20/2014 11:57:38 PM    

Hello,

To avoid discussing multiple topics in this thread, I created a separate ticket on your behalf: T142423: ASPxGridView - Batch Edit - How to use ASPxGridLookup bound to a large database with incremental filtering in EditItemTemplate. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.

Added By: Zoltán Gelencsér at: 6/23/2015 5:23:30 AM    

Dear Support Team,

I've integrated this solution into my project.
It is working well but I have little (huge) problem with it.
If I use Enter key to move cursor from the column to the next column, which is a cascased combobox, and I'm fast and I use 2 times Enter key the combobox value is shown and cleared and the focused column is the next column after combobox.

I've analyzed the code.
The OnBatchEditStartEditing set value of Combobox but the PerformCallback of combobox clears it.
In client side event endcallback I reset it back to the original value. It is working well if I do not leave the combobox column fast.

I hope you have solution for this problem.

Best Regards,

Zoltán

Added By: Artem (DevExpress Support) at: 6/24/2015 1:30:14 AM    

Hello Zoltán,

To process your recent post more efficiently, I created a separate ticket on your behalf: T259299: ASPxGridView - Batch Edit - Issue with cascading comboboxes. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.

How to: Use the XPO OData V3 Service

$
0
0

To start the service, run the ODataService project. To start the client application, run the ODataV3Example project.

OBSOLETE - GridView - Batch Editing - How to use external buttons to update data and enable them only when a row/cell has been changed

$
0
0

UPDATED:

Starting with v16.1, this feature is available out of the box. Please refer to the ASPxGridView, ASPxCardView - Change Save and Cancel buttons' enabled state when an end-user changes a value in BatchEdit mode thread for additional information.

 
For earlier versions: 

This example demonstrates how to create separate Update and Cancel buttons for GridView and disable them if the grid has no any modifications. 


See Also:
GridView - Batch Editing - How to show save and cancel buttons only when any row/cell has been changed

ASP.NET WebForms example:

ASPxGridView - Batch Editing - How to use external buttons to update data and enable them only when a row/cell has been changed  

OBSOLETE - GridView - How to implement navigation by Up/Left/Down/Right keyboard arrows in the Batch Edit mode

$
0
0

UPDATED:

Starting with version v2016 vol 1 (v16.1), this functionality is available out of the box. Set the grid's ASPxGridView.SettingsEditing.BatchEditSettings.StartEditAction property to the FocusedCellClick value to activate it. Please refer to the ASP.NET Grid - Cell Bands, Cell Merging, and Cell Focus - (Coming soon in v16.1) blog post, the Batch Editing and Updating demo and ASPxGridView - Batch Edit - Provide cell focusing and keyboard navigation thread for more information.

If you have version v16.1+ available, consider using the built-in functionality instead of the approach detailed below.

For earlier versions:

This example illustrates how to implement custom keyboard navigation in Batch Edit mode.  
The main idea is to handle the keydown event for the grid's HTML table and manually switch the next cell to edit mode using  the ASPxClientGridViewBatchEditApi.StartEdit  method. 
The ASPxClientGridView.BatchEditStartEditing  event is used to remember the last editing row and column indices.

Note that keyboard navigation (via arrows) won’t work well for such editors as the ComboBox and SpinEdit because they have their own key event handlers, which will prevent custom logic from being executed. So, this approach is mainly for TextBox and Memo editors. However, it will be possible to use different keys in this scenario. 

This example doesn't implement data updates. Please refer to the GridView - A simple Batch Editing implementation example illustrating how to work with a model in Batch Edit mode.

Web Forms: 
ASPxGridView - How to implement navigation by Up/Left/Down/Right buttons when the Batch Edit mode is used

Viewing all 7205 articles
Browse latest View live
<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>