To customize data source wizard use the DashboardDesigner.DataSourceWizardCustomization Property.
When a data source is selected, a custom ConfigureQueryPageView is shown. This view displays a list of tables from the selected data source, and automatically generates a query when a certain table is selected.
DashboardDesigner - How to customize the data source wizard to display a list of available tables after target data base selection
SqlDataSource - How to use ExpressionEvaluator to programmatically filter report data
Other examples of using DevExpress.Data.Filtering.Helpers.ExpressionEvaluator appear here:
How to get one calculated field value in the other calculated field's GetResult event handler by using ExpressionEvaluator
How to evaluate the calculated field expression
First and last column value
How to implement cascading lookups
This example demonstrates how to implement cascaded lookups. The main idea is to get the changed value of the first lookup and select data based on this value for the second lookup. It is necessary to perform the following steps:
1. Handle the dxLokup.valueChangeAction event of the first lookup;
2. In this event handler pass the selected value of the first lookup to the DataSource.filter method of a data source that is related to the second lookup.
See also:
dxDataGrid - How to implement cascading lookup columns
OData Associations
ODataContext
dxLookup
ODataContext - How to filter data by a foreign key value
Question Comments
Added By: Jeffrey Hodgson at: 10/5/2015 12:14:31 PM
The links I'm referring to are the following and the result of clicking on them is as below -
dxLokup.valueChangeAction - Document not found
DataSource.filter - Document not found
OData Associations - Document not found
ODataContext - Document not found
dxLookup - Document not found
ODataContext - How to filter data by a foreign key value - does link to something except DevExpress
This is DevExtreme I'm using NOT DevExpress.
Added By: Nikolai (DevExpress Support) at: 10/6/2015 12:33:46 AM Hi Jeffrey,Thank you for bringing this to our attention. I've fixed URLs of these links. Please test them and let me know your results.
dxDataGrid - How to implement cascading lookup columns
1. Reset a value in a cell of the second lookup column (the Product column) when a cell value in the first lookup column (the Category column) is changed. We need to use the dxDataGrid.columns.setCellValue callback function for this. This function accepts two parameters. The first one is data of the current row, and the second one is the inputed value. So, our code should be as follows:
[JScript]{ dataField: 'Category', setCellValue: function(rowData, value){ rowData.Product = null;this.defaultSetCellValue(rowData, value);},...}
2. We need to filter values for a cell in the second lookup column based on the current value from the first column. In this case, we can specify the dxDataGrid.columns.lookup.dataSource option as a callback function. This function must return a data source configuration object and we can specify the filter expression for our data source based on the current value of the first lookup column. The data option will help us to do this. So, the code should be as follows:
[JScript]{ dataField: 'Product', lookup: { dataSource: function(options){var dataSourceConfiguration = { store: products};if(options.data){ dataSourceConfiguration.filter = ['CategoryID', '=', options.data.Category];}return dataSourceConfiguration;},...}}
See also:
How to implement cascading lookups
How to preserve the XtraGrid view state in multi level master/detail
This example is an extension of example How to preserve the XtraGrid View state for a grid in master-detail mode. It stores view states of all existing nested grid views.
Question Comments
Added By: Glenn Holden at: 6/19/2014 12:13:58 PM
This class is significantly different than the example which it is based on. Could you provide a Form class to demonstrate how this RefreshHelperClass is implemented?
Added By: Nikita (DevExpress Support) at: 6/19/2014 11:47:34 PMHello,
I have modified the sample so that the form's code is visible on the Web. You can also load the full project by clicking the Example link on the right side of this page (I have attached a screenshot that shown this link).
I hope this helps.
If I'm rigth, this example is prepared to deal with views whose key is composed only by 1 column (keyFieldName in ViewDescriptor structure is declared as String). In that case, how would you change it to allow views with multiple columns keys?
Added By: Svetlana (DevExpress Support) at: 6/1/2015 12:57:13 AMHello,
To process your recent post more efficiently, I created a separate ticket on your behalf: T249139: How to use a compound key in the E1466 example. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.
Hi,
In your sample code, How many views are designed as known? How about "Dynamic MasterDetail Views"? i.e. How many views are not known. They are dynamic created, in theory, there can be unlimited detail views. For more details, when use "Dynamic MasterDetail Views" for a tree-like data structure. (ID,ParentID). There can be unlimited number of detail data level in the tree.
Hello,
To process your recent post more efficiently, I created a separate ticket on your behalf: How many views are designed as known. This ticket is currently in our processing queue. Our team will reply it as soon as we have any updates.
How to drag and drop items from/to ASPxListBox using jQuery UI
It is not possible to drag items from ASPxListBox until the Enable drag & drop in ASPxListBox suggestion is implemented.
The example illustrates how this functionality can be implemented using jQuery UI.
See also:
How to drag and drop items from/to ASPxListBox using jQuery UI when item's ImageUrl is used
Question Comments
Added By: Akil Kumar Thamala at: 1/21/2016 7:42:10 AM
This code does not work, if I run it on Tab (android version). Any suggestions?
Regards
Akil
Hello,
To process your recent post more efficiently, I created a separate ticket on your behalf: T337190: The ' How to drag and drop items from/to ASPxListBox using jQuery UI' example does not work on Android devises. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.
How to select a current line in the RichEditControl
This example illustrates the use of the StartOfLineCommand and EndOfLineCommand that allows you to determine start and end positions of the current line. It is important to distinguish line and paragraph terms because they are different in the context of the RichEditControl. Paragraph represents a single paragraph in a document. Paragraphs are delimited by the \r\n character pair. As for the line, it is a range of non-breakable text (i.e. a range of text that is not wrapped to the next row). There is no special API for lines and you should use the aforementioned commands to work with them.
Question Comments
Added By: Zina Ge at: 1/22/2016 12:51:34 AM
It works.Thank you
GridView - How to implement date range filtering using a custom editor in the AutoFilterRow
v15.2
This example is now obsolete. Starting with v15.2, we implemented a new GridViewDataColumnHeaderFilterSettings.Mode property. Please refer to the Date Range Header Filter demo.
For older versions:
This example demonstrates how to implement date range filtering in the GridView extension.
Use the MVCxGridViewColumn.SetFilterTemplateContent method to create a custom editor and assign a delegate method to the GridViewSettings.ProcessColumnAutoFilter property to process a custom filter expression sent from the client side.
See also:
E1990: Date range filtering in the Filter Row
Question Comments
Added By: Gustavo Sainz at: 11/11/2014 11:08:43 AM
I can't make it to work, as the ProcessColumnAutoFilter does not trigger when settings the grid to use
settings.CustomBindingRouteValuesCollection.Add(GridViewOperationType.Filtering, new { Controller = "ViewDate", Action = "AdvancedCustomBindingFilteringAction", key = "-1" });
Any idea how to resolve this?
Added By: Vladimir (DevExpress Support) at: 11/11/2014 10:25:08 PMHello,
To process your recent post more efficiently, I created a separate ticket on your behalf: T171947: The ProcessColumnAutoFilter does not trigger. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.
I've implemented this technique in our solution and it seems to basically work. The user's current selections are displayed in the EndCallback function via "dde.SetText". However, when the user manually clears out those values I would like the custom filtering to be removed, which is the same behavior for a "normal" field. I'd also like to allow the user to type a date range in their manually ("03/01/2015|04/01/2015") and have the same affect as though those dates were selected via the calendar popup.
How can I get that to happen? I haven't been able to figure out what event(s) should be captured. Having the user manually enter dates isn't critical, but we'd definitely like to be able to have those cleared values reset the filtering for the column.
Note that we haven't yet upgraded to v2015, so we're looking for a v2014 solution, if possible.
Added By: Artem (DevExpress Support) at: 1/22/2016 4:31:27 AMHello Don,
To process your recent post more efficiently, I created a separate ticket on your behalf: T337328: Improve date range filtering example. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.
How to create a data bound report dynamically in a WinForms application
This example illustrates how to generate a report dynamically.
For further information please refer to the corresponding article : How to create a report dynamically
Question Comments
Added By: Daniel Kaminski at: 7/7/2015 8:52:01 AM
Please update this project to .NET 4.0. It will not compile in .NET 3.5
Added By: Jannet (DevExpress Support) at: 7/8/2015 3:38:29 AM Hello Daniel,Thanks for pointing this out. I have updated the example solution for the 13.1.4 — 15.2.2 builds. Feel free to let me know if I can be of further help.
How to prevent an end-user from hiding a specific grid column
This example demonstrates how to prevent an end-user from hiding a specific grid column. For this, you first need to create a RemoveColumnDropTarget class descendant and override the Drop method. Then, create a TableView class descendant and override the CreateEmptyDropTarget method, which should return an instance of the RemoveColumnDropTarget descendant. And finally, create an attached property for the AbsoluteVisible.IsEnable columns.
To prevent all columns from being hidden, use the built-in AllowMoveColumnToDropArea property.
How to use jQuery to drag and drop items from one ASPxGridView to another
The example demonstrates how to use the jQuery framework to drag an item from one grid to another.
- Use jQuery UI Draggable and Droppable plug-ins;
- Define "draggable" and "droppable" items:
[ASPx]<Styles><TableCssClass="droppableLeft"></Table><RowCssClass="draggableRow left"></Row></Styles>
- Use the invisible ASPxGlobalEvents control and handle its client-side ControlsInitialized/EndCallback events;
- Initialize the defined draggable/droppable items via the corresponding jQuery selectors. The "start" event handler can be used to obtain the key of the dragged row and apply conditional styling to it:
[JScript]start: function(ev, ui){var $sourceElement = $(ui.helper.context);var $draggingElement = $(ui.helper); //style elements $sourceElement.addClass("draggingStyle"); $draggingElement.addClass("draggingStyle"); //find keyvar sourceGrid = ASPxClientGridView.Cast($draggingElement.hasClass("left") ? "gridFrom" : "gridTo"); rowKey = sourceGrid.GetRowKey($sourceElement.index() - 1);}
- Handle the "drop" event of the "droppable" items and perform a callback to the callback panel that has both grids nested inside to perform the data editing functionality.
Select the "script.js" source file and review the comments to find an illustration of the above steps.
See Also:
T116869: GridView - How to drag and drop items from one grid to another
E4582: How to reorder ASPxGridView rows using buttons or drag-and-drop
Question Comments
Added By: Marc Michaels at: 1/16/2013 6:03:17 AM
Where is DX.ashx? I can't find any mention of it anywhere.
Added By: Marc Michaels at: 1/16/2013 6:14:32 AM<div class="draggable"> ??? Can't find this anywhere in the example as well. This example really leaves me in the dark there is no explanation of anything. Sadly it's the closest thing I can find to help me drag from one grid and drop on another. Just going to have to struggle through it.
Added By: Marc Michaels at: 1/16/2013 6:21:13 AMRunning example simply results in "The resource cannot be found".
Added By: Mark OMeara at: 8/19/2014 6:59:25 PMCan this example be adjusted to also drag and drop within the same grid? i.e. for ordering of rows?
Added By: Anthony (DevExpress Support) at: 8/20/2014 5:18:06 AMHi Mark,
We have the How to reorder ASPxGridView rows using buttons or drag-and-drop example that shows how to reorder grid rows using the same jQuery UI library. Please use the approach from it to accomplish your task.
Can you post the code for the Helper class used in the code behind of Default.aspx?
Added By: Artem (DevExpress Support) at: 11/12/2014 11:49:36 PMHello Nicholas,
I've made this class visible in web. Note that you can download this example using the Downloads - > Example link and research it locally.
Thanks,
Artem
This code works fine on my Android tab. But when I place the same controls (Grids) in ASPxNavBar and run it on the Tab, it does not work any suggestions?
Added By: Pavlo (DevExpress Support) at: 1/22/2016 5:23:48 AMHello,
I see that you've already asked a similar question in the context of the ASPxGridView does not work when placed in the ASPxNavBar ticket. Let us continue our discussion there.
DocumentPreviewControl - How to: Create a Drill-Down Report (Runtime Sample)
To achieve the same functionality without writing a line of code, use the approach described in the How to: Create a Drill-Down Report topic.
See also:
How to: Create a Drill-Down Report (Runtime Sample)
How to create a drill-through report in WPF
How to filter data on the server side with XtraReports Parameters
The criteria you specify in the XtraReport.FilterString property is applied to data source rows by the report control on the client side by default. When working with large data sets, it makes sense to apply this filter directly to the data source to avoid excessive data transfer. This task can be accomplished by creating the following scripts in the report:
[C#]privatevoidxafReport1_DataSourceDemanded(objectsender,System.EventArgse){DevExpress.Data.Filtering.OperandValue[]prameterOperands;DevExpress.Data.Filtering.CriteriaOperatorcriteria=DevExpress.Data.Filtering.CriteriaOperator.Parse(xafReport1.FilterString,outprameterOperands);foreach(DevExpress.Data.Filtering.OperandValuetheOperandinprameterOperands){DevExpress.Data.Filtering.OperandParameteroperandParameter=theOperandasDevExpress.Data.Filtering.OperandParameter;if(!object.ReferenceEquals(operandParameter,null)){DevExpress.XtraReports.Parameters.Parameterparam=xafReport1.Parameters[operandParameter.ParameterName];if(param!=null)operandParameter.Value=param.Value;}}DevExpress.ExpressApp.Reports.XafReportxafReport=(DevExpress.ExpressApp.Reports.XafReport)xafReport1;IListoriginalDataSource=xafReport.ObjectSpace.GetObjects(xafReport.DataType,criteria);xafReport1.DataSource=newDevExpress.ExpressApp.ProxyCollection(xafReport.ObjectSpace,DevExpress.ExpressApp.XafTypesInfo.Instance.FindTypeInfo(xafReport.DataType),originalDataSource);}
UPDATE:
Note that the new Reports V2 Module provides the server-side filtering capability out of the box. Refer to the Data Filtering in Reports V2 article for details.
Question Comments
Added By: Gustavo Marzioni at: 4/2/2013 12:10:16 PM
Why this funcionality, that is very important is not included in XafReport??
Added By: Ken Gliddon at: 2/10/2014 10:39:38 PMPlease help with this report parameters. If I add it to the script the parameters panel on the report shows yet when select a parameter it generates the SQL query which fails saying Conversion failed when converting from character string to uniqueidentifier, the parameter sample seems to fail when using the Oid from the selected paramters
Added By: Adrian D Ilie at: 2/16/2014 12:04:24 AMWhat happens if a parameter is a non-persistent property, which cannot be automatically translated into a SQL query for server filtering? A simple example: a non-persistent IsActive property that looks at two persistent properties, StartDate and EndDate, and returns true if today's date falls between them, or EndDate is null. Filtering by IsActive is performed on the client, correct? Is filtering by other criteria, which do not rely on non-persistent properties, performed automatically on the server? I ask because I can, with some effort, translate the algorithm that computes the non-persistent property into a script that creates the same condition but relies exclusively on persistent properties, which can be filtered on the server. This effort would be worth my time if having a single non-persistent property causes filtering to be performed on the client, without taking advantage of the other persistent properties which can be filtered on the server.
Added By: Gustavo Marzioni at: 11/24/2015 6:48:51 AMI have to use it in DataSourceDemanded not in BeforePrint, because it don't work for child collections
Added By: Michael (DevExpress Support) at: 11/25/2015 3:27:48 AM If you have any difficulty with this solution, please feel free to submit a new ticket and describe the issue in detail. We will do our best to help you.How to implement the drag-and-drop functionality for PictureEdit so it is possible to drop images to it from Windows Explorer
This example illustrates how to drag and drop images from Windows Explorer to PictureEdit. For this it is sufficient to create DragDropProvider and call the EnableDragDrop method. Also, in this example you can drag and drop images from two buttons onto an application form.
Question Comments
Added By: Kraven Vazquez at: 6/8/2013 6:37:44 PM
This implement on drag drop provider works nice but I need to get the path file for dropped picture on a textedit control, please if you can help me with this, thank you.
Added By: devexpress devexpress 1 at: 1/24/2016 10:45:59 PMyes it works only when dragging from simple button but not working from windows explorer !!
i want to drag from windows explorer
Hello,
To process your recent post more efficiently, I created a separate ticket on your behalf: T337845: E3171 - Works only when dragging from simple button but not working from windows explorer. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.
How to create a custom theme for shapes in DiagramDesignerControl
Shapes in the Diagram control are colored according to the applied theme. To create a custom theme, add a resource dictionary with a Theme element to your application.
Each theme should contain a color palette. To specify a color palette, add the ColorPalette element into the Theme.
To specify how colors are used in a theme, set the Theme.Effects property. This property accepts the EffectCollection object. EffectCollection defines colors shown in the following gallery:
Clik here to view.
EffectCollection has the following properties:
-ThemeEffects. Specifies colors in the "Theme Styles" group.
-VariantEffects. Specifies colors in the "Variant Styles" group. When a shape is created its default color scheme is taken from this group.
-ConnectorEffects. Specifies connector colors.
To register a custom theme, use the ThemeRegistrator.RegisterThemes method.
How to display and hide the horizontal scrollbar automatically
This example shows how to show the horizontal scrollbar if the PivotGrid gets wider than 800 pixels and hides the scrollbar if the PivotGrid gets smaller than 800 pixels.
Question Comments
Added By: Sebastien Desmarais at: 1/25/2016 1:14:07 PM
I was looking for a way to control pivotgrid's scrollbars depending of browser dimensions but this demo doesn't seem to work...
How to modify the context menu of grid columns
The following example demonstrates how to customize the grid's context menu at runtime. For instance this sample demonstrates how to remove the default 'Show Column Chooser' menu item from the Column Context Menu, and add a custom item instead.
Question Comments
Added By: Sævar Kristinsson at: 2/6/2013 6:42:06 AM
Hi, I would want to modify the column header context menu in design time. The only example I have found that touches this topic is this example or similar to it i.e. modifying the context menu in runtime. Could you guys give an example on how to do this in design time?
Added By: Thomas R Melinsky at: 5/27/2014 6:18:22 AMIs there a new version of this example for WPF that isn't event driven?
Added By: Ilya (DevExpress Support) at: 5/27/2014 9:08:19 AMHi Thomas,
Currently, the approach demonstrated in his example is the appropriate way to customize the grid popup menu at runtime. Would you please clarify why it is not an option for you?
Hi, how to add this into styles? So that the functionality is avialable to all the grids in an application.
Added By: Ivan (DevExpress Support) at: 5/26/2015 12:24:08 AMAs I can see, you have recently created a similar ticket - T246541. I have updated it to describe your requirements. We will answer you there soon.
Added By: Ahmed Bayyari at: 1/25/2016 1:20:56 PMGridMenuEventArgs is obsolete. Could you please put an example using PopupMenuShowingEventArgs which DevExpress recommends to use instead of GridMenuEventArgs. The method e.Customizations doesn't exist when using PopupMenuShowingEventArgs.
ASPxCardView - How to customize command buttons in individual cards
How to pass a hidden dashboard parameter to a custom SQL query in the WinForms Viewer
The following example shows how to filter a custom SQL query by changing a parameter value in the DashboardViewer.CustomParameters event handler.
In this example, the custIDQueryParameter query parameter is included in a WHERE clause of a custom SQL query. The custIDQueryParameter parameter is also bound to the hidden custIDDashboardParameter dashboard parameter. The value of this parameter is changed at runtime by handling the DashboardViewer.CustomParameters event which is raised before the DashboardViewer sends a query to a database.
ASPxCardView - How to iterate through column editors on the client
This approach cannot be used when edit templates are defined.