Using DXDocking for WPF in accordance with Composite Application Guidelines
How to resize columns when column headers are hidden
By default, columns can be resized only using column headers. However, when column headers are hidden (DataViewBase.ShowColumnHeaders is false), they cannot be used for resizing. To change column width in this scenario, the DXThumb element can be used. Create a DXThumb descendant and implement the IColumnPropertyOwner interface. Then, use this descendant in the CellTemplate.
Note
In optimized mode (version v14.1 and higher), a non-optimized editor (TextEdit) can be replaced with a lightweight editor (InplaceBaseEdit) as demonstrated below.
[XAML]<grd:TableView.CellTemplate><DataTemplate><DockPanelLastChildFill="True"> ...<dxe:InplaceBaseEditName="PART_Editor"/></DockPanel></DataTemplate></grd:TableView.CellTemplate>
See Optimized Mode Styles and Templates for more information.
How to define Prism regions for various DXDocking elements
This example demonstrates how to use DXDocking with PRISM. To obtain more information about how to accomplish this in a particular version, press the Show Implementation Details link.
Question Comments
Added By: K.Wessing at: 6/21/2012 1:19:15 AM
starting in version 12.1 I get an exception, in version 11.2 the sample did work
(I based my application on this)
System.ArgumentException was unhandled by user code
Message=This RegionManager does not contain a Region with the name 'LeftRegion'.
Parameter name: regionName
Source=Microsoft.Practices.Prism
ParamName=regionName
StackTrace:
at Microsoft.Practices.Prism.Regions.RegionManagerExtensions.AddToRegion(IRegionManager regionManager, String regionName, Object view)
at PrismOnDXDocking.ExampleModule.ExampleModule.Initialize() in C:\Users\k.wessing\Documents\Samples\DXDocking for WPF\12.1.4\E3339\PrismOnDXDocking.ExampleModule\Module.cs:line 58
at Microsoft.Practices.Prism.Modularity.ModuleInitializer.Initialize(ModuleInfo moduleInfo)
InnerException:
I downloaded this example and tried to run it via your example runner. We are using DXv2 (12.1) and it generates an exception as found by K.Wessing above. I also made sure I was using an up-to-date version of Prism Mef (v4.1):
System.ComponentModel.Composition.CompositionException was unhandled
Message=The composition produced a single composition error. The root cause is provided below. Review the CompositionException.Errors property for more detailed information.
1) This RegionManager does not contain a Region with the name 'LeftRegion'.
Parameter name: regionName
Resulting in: An exception occurred while initializing module 'ExampleModule'.
- The exception message was: This RegionManager does not contain a Region with the name 'LeftRegion'.
Parameter name: regionName
- The Assembly that the module was trying to be loaded from was:PrismOnDXDocking.ExampleModule, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
Check the InnerException property of the exception for more information. If the exception occurred while creating an object in a DI container, you can exception.GetRootException() to help locate the root cause of the problem.
Resulting in: An exception occurred while calling the 'OnImportsSatisfied' method on type 'Microsoft.Practices.Prism.MefExtensions.Modularity.MefModuleManager'.
Resulting in: Cannot activate part 'Microsoft.Practices.Prism.MefExtensions.Modularity.MefModuleManager'.
Element: Microsoft.Practices.Prism.MefExtensions.Modularity.MefModuleManager --> Microsoft.Practices.Prism.MefExtensions.Modularity.MefModuleManager --> AssemblyCatalog (Assembly="Microsoft.Practices.Prism.MefExtensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35")
Resulting in: Cannot get export 'Microsoft.Practices.Prism.MefExtensions.Modularity.MefModuleManager (ContractName="Microsoft.Practices.Prism.Modularity.IModuleManager")' from part 'Microsoft.Practices.Prism.MefExtensions.Modularity.MefModuleManager'.
Element: Microsoft.Practices.Prism.MefExtensions.Modularity.MefModuleManager (ContractName="Microsoft.Practices.Prism.Modularity.IModuleManager") --> Microsoft.Practices.Prism.MefExtensions.Modularity.MefModuleManager --> AssemblyCatalog (Assembly="Microsoft.Practices.Prism.MefExtensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35")
Source=System.ComponentModel.Composition
StackTrace:
at System.ComponentModel.Composition.Hosting.CompositionServices.GetExportedValueFromComposedPart(ImportEngine engine, ComposablePart part, ExportDefinition definition)
at System.ComponentModel.Composition.Hosting.CatalogExportProvider.GetExportedValue(ComposablePart part, ExportDefinition export, Boolean isSharedPart)
at System.ComponentModel.Composition.Hosting.CatalogExportProvider.CatalogExport.GetExportedValueCore()
at System.ComponentModel.Composition.Primitives.Export.get_Value()
at System.ComponentModel.Composition.ExportServices.GetExportedValueFromLazy[T](Export export)
at System.ComponentModel.Composition.Hosting.ExportProvider.GetExportedValueCore[T](String contractName, ImportCardinality cardinality)
at System.ComponentModel.Composition.Hosting.ExportProvider.GetExportedValue[T](String contractName)
at System.ComponentModel.Composition.Hosting.ExportProvider.GetExportedValue[T]()
at Microsoft.Practices.Prism.MefExtensions.MefBootstrapper.InitializeModules()
at Microsoft.Practices.Prism.MefExtensions.MefBootstrapper.Run(Boolean runWithDefaultConfiguration)
at Microsoft.Practices.Prism.Bootstrapper.Run()
at PrismOnDXDocking.App.OnStartup(StartupEventArgs e) in C:\Users\anielsen\Downloads\DXDocking for WPF\12.1.4\E3339\PrismOnDXDocking\Application.xaml.cs:line 34
at System.Windows.Application.<.ctor>b__1(Object unused)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
at System.Threading.ExecutionContext.runTryCode(Object userData)
at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Windows.Threading.DispatcherOperation.Invoke()
at System.Windows.Threading.Dispatcher.ProcessQueue()
at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
at System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
at System.Windows.Threading.Dispatcher.TranslateAndDispatchMessage(MSG& msg)
at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.Run()
at System.Windows.Application.RunDispatcher(Object ignore)
at System.Windows.Application.RunInternal(Window window)
at System.Windows.Application.Run(Window window)
at System.Windows.Application.Run()
at PrismOnDXDocking.App.Main() in C:\Users\anielsen\Downloads\DXDocking for WPF\12.1.4\E3339\PrismOnDXDocking\obj\x86\Debug\Application.g.cs:line 50
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:
Hello, we have an issue with your sample E3339 (related to the use of regions and adapters). The sample is successfully working with the 11.2.11 version in one of our testing computers. But we’re now integrating the last version of DevExpress (12.1.4) in our sandbox computer and it doesn’t work: the project is compiling but it doesn’t work (the adapters aren’t working: the flow execution isn’t entering in the adapters, in the function Adapt). We’re experiencing the same problem than K.Wessing: System.ArgumentException was unhandled by user code
Message=This RegionManager does not contain a Region with the name 'LeftRegion'.
We have been checking your technical support and it seems there was another issue between the 11.1.x and the 11.2.x, and your teams adapted the sample project for the new DevExpress version. Is it possible that it’s happening the same?
Thanks,
Juan Lopez
I am using the LayoutGroupAdapter
I would like to be able to switch from one view to an other within the same LayoutGroup region.
I 've added the Remove action:
if (e.Action == NotifyCollectionChangedAction.Remove)
{
regionTarget.Items.Clear();
}
Scenario:
in region : <dxd:LayoutGroup cal:RegionManager.RegionName="{x:Static Infrastructure:RegionNames.DetailsRegion}" />
#1 Add a viewA - OK
#2 Remove viewA - OK
#3 Add viewB - OK
#4 Remove viewB - OK
#5 add viewA - Getting ERROR below
Please advice.
Thank you
-
{"Specified element is already the logical child of another element. Disconnect it first."}
-
at System.Windows.FrameworkElement.ChangeLogicalParent(DependencyObject newParent)
at System.Windows.FrameworkElement.AddLogicalChild(Object child)
at DevExpress.Xpf.Docking.LayoutPanel.OnControlPropertyChanged(UIElement control, UIElement oldControl)
at DevExpress.Xpf.Docking.LayoutPanel.OnControlChanged(UIElement control, UIElement oldControl)
at DevExpress.Xpf.Docking.LayoutPanel.<.cctor>b__1(DependencyObject dObj, DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
...
The Remove event is not handled in the documentgroup adapter which does not reclaim the memory when tab is closed.
Added By: Simon Cui 1 at: 8/12/2013 9:13:37 AMHide the leftregion, the navbar be removed, and hide leftregin again, throw error.
Added By: Sergey Wereteychenko at: 9/3/2013 12:27:27 AMWhy this example is so bugged?
After detaching a panel - disappears a content, please try detach Toolbox...
And why this example craches every time, when attach-detach event happening...
Please, supply Working example.
Added By: Sergey Wereteychenko at: 9/3/2013 12:36:20 AMprivate void OnItemsCollectionChanged(IRegion region, LayoutGroup regionTarget, object sender, NotifyCollectionChangedEventArgs e)
{
if (lockItemsChanged)
{
return;
}
if (e.Action == NotifyCollectionChangedAction.Remove)
{
lockViewsChanged = true;
var lp = (LayoutPanel)e.OldItems[0];
var view = lp.Content;
//lp.Content = null;
region.Remove(view);
lockViewsChanged = false;
}
}
Cause of removing content is "lp.Content = null;" row...
Why was existing this row in example?
Can you complete the code for remove action. We have something as below to remove any tabs that are floating or in the default layout group. it does not find tabs in newly created layout groups.
case NotifyCollectionChangedAction.Remove:
List<DocumentPanel> panelToRemove = new List<DocumentPanel>();
List<FloatGroup> floatGroupToRemove = new List<FloatGroup>();
DockLayoutManager managerRemove = regionTarget.GetDockLayoutManager();
foreach (DocumentPanel panel in regionTarget.Items)
{
foreach (IPanelInfo oldItem in e.OldItems)
{
if (panel.Caption.Equals(oldItem.Title))
{
panelToRemove.Add(panel);
}
}
}
foreach (DocumentPanel pnl in panelToRemove)
{
regionTarget.Items.Remove(pnl);
}
panelToRemove.Clear();
foreach (var floatGroup in managerRemove.FloatGroups)
{
foreach (DocumentPanel panel in floatGroup.Items)
{
foreach (IPanelInfo oldItem in e.OldItems)
{
if (panel.Caption.Equals(oldItem.Title))
{
panelToRemove.Add(panel);
}
}
}
foreach (DocumentPanel pnl in panelToRemove)
{
floatGroup.Items.Remove(pnl);
}
if (floatGroup.Items.Count == 0 )
{
floatGroupToRemove.Add(floatGroup);
}
}
foreach (FloatGroup floatGroup in floatGroupToRemove)
{
managerRemove.FloatGroups.Remove(floatGroup);
}
break;
Added By: Artem Dubenko 2 at: 8/6/2015 12:54:59 PMUnfortunately this example doesn't support selection/activation of the views. A call to IRegion.Activate(view) will have no effect.
Added By: Ivan (DevExpress Support) at: 8/7/2015 6:04:44 AM Hi Artem,I have created a new question on your behalf and posted this question there - How to activate a panel when calling IRegion.Activate. Please refer to my answer in that ticket.Added By: Nelson Peña at: 10/30/2015 9:19:11 AM
There is an error when the Region (TabbedGroup) is unpinned and you try to open a new view in that region.
The situation is that when de TabbedGroup is unpinned also it's removed from the regions in the region manager, so the error is: This RegionManager does not contain a Region with the name 'TabRegion'.
The DockLayoutManager creates an AutoHideGroup and moves all the items from the TabbedGroup unpinned to this new AutoHideGroup but doesn't maintain the relation with the Region.
I'm using the v14.2 version. How is possible to manage this behavior?
Added By: Andrey Marten (DevExpress Support) at: 11/1/2015 8:53:13 PM
Hello,
To process your recent post more efficiently, I created a separate ticket on your behalf: T306639: The 'TabRegion' is removed from regions in the E3339 example when TabbedGroup is unpinned. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.
Thanks,
Andrey
How to implement custom zooming for the chart control in a Windows Forms application
NOTE. Starting with v17.1, zooming a chart via the mouse wheel scales the chart to the current mouse position and the custom zooming method shown in this example is no longer necessary.
This example demonstrates how to implement custom zooming for the chart control. To accomplish this task, you can handle the MouseWheel event. Within this event handler, you can call the XYDiagram.PointToDiagram method to obtain information relative to the coordinates of the mouse pointer affiliation with a series or series point in a diagram. After that you can manually assign both minimum and maximum internal values of an axis range as your needs dictate.
How to create persistent classes mapped to tables with a composite primary key at runtime
When you have a table with a composite key, the standard solution to map an XPO persistent class to it is to declare a structure for the key member as described in the How to create a persistent object for a database table with a compound key article. If the database schema is not known as design time, and you need to create persistent classes at runtime, the built-in XPDictionary methods won't help, because structure-like members are supported only for real types via Reflection. This example demonstrates how to create a custom XPCustomMemberInfo descendant to support nested persistent members.
See also:
K18482: How to create persistent metadata on the fly and load data from an arbitrary table
XPMemberInfo
Question Comments
How to override default colors from an existing Color Scheme in Windows 10 XAML controls [Deprecated]
This example illustrates how to override default colors from an existing color scheme in Windows 10 XAML controls. In the current implementation, the background of the RibbonControl header is overridden to #FF217346 in the Generic scheme and to #FF093467 in the Win8 scheme.
Colors should be overridden within a separate ResourceDictionary file. Then, this dictionary should be used in the Source property of the GlobalColorSchemeOverrider class.
All colors available for overriding are listed in separate files within the installation folder with our controls: <DevExpress Installation Folder>\Components\System\UAP\ColorThemes
How to override default colors from an existing Color Scheme in Windows 10 XAML controls and support system themes (Light, Default) [Deprecated]
This example illustrates how to override default colors from an existing color scheme in Windows 10 XAML controls and support system themes (Light, Default). In the current implementation, the background of the RibbonControl header is overridden in Generic and Win8 schemes and has different values in these schemes for the Default and Light system themes.
Colors should be overridden within a separate ResourceDictionary file and used in the Source property of the GlobalColorSchemeOverrider class.
Certain system theme colors must be declared in a separate ResourceDictionary in the color scheme ResourceDictionary's ThemeDictionary collection as follows:
[XAML]<ResourceDictionaryx:Key="Generic"><ResourceDictionary.ThemeDictionaries><ResourceDictionaryx:Key="Default"><SolidColorBrushx:Key="RibbonHeaderBackgroundBrush"Color="#FF164B2F"/> ...</ResourceDictionary><ResourceDictionaryx:Key="Light"><SolidColorBrushx:Key="RibbonHeaderBackgroundBrush"Color="#FF418366"/> ...</ResourceDictionary></ResourceDictionary.ThemeDictionaries> ... </ResourceDictionary>
Note:
1. Our controls have the same appearance in different system themes when the Win8 color scheme is applied. System themes are supported in our controls out of the box only when the Generic color scheme is applied.
2. The Dark system theme is determined as Default and colors in the Generic color scheme for both these themes are the same.
All colors available for overriding are listed in separate files within the installation folder with our controls: <DevExpress Installation Folder>\Components\System\UAP\ColorThemes
How to change background color for modified cells
This example demonstrates how to highlight grid cells that have been edited by a user. Please note that cells won't be highlighted if data is changed at the data source level.
Question Comments
Added By: Jared Hayden at: 9/27/2012 8:53:02 AM
This method is terrible. you are creating an IsEdited_ column for every column created and hiding that column. Just to store a Boolean. DevExpress doesn't have a better way of changing the color of a modified cell?
Added By: Alexander Ch (DevExpress Support) at: 12/9/2013 10:36:06 PMIndeed, this approach implies that you don't have many columns or you wish to highlight cells only for specific fields. Otherwise, I suggest that you choose one of the approaches described in the following links:
http://www.devexpress.com/Support/Center/Question/Details/Q434526
http://www.devexpress.com/Support/Center/Example/Details/E4025
How to make the auto filter row's filter accent insensitive
This example demonstrates how to create a custom function that removes all diacritic symbols from the specified string value. Using the GridView.SubstituteFilter event, this function can be injected into the active grid filter.
The SubstituteFilter event was added in version 2015 vol 1. To accomplish this task in older version, create a custom grid and customize the mechanism of filtering data via the auto filter row. For this, the GridView.RaiseCustomRowFilter method can be overridden. In this method, the cell text and filter string should be normalized via the standard String.Normalize method and then the cell value is processed based on the comparison operator type returned via the OptionsColumnFilter.AutoFilterCondition property.
Question Comments
Added By: Martin Šváha at: 8/26/2016 2:33:32 AM Dear DevExpress support.
I have used SubstituteFilter event for accent insensitive GridView in GridLookupEdit.
There is a problem and I can't find solution for typing with accent insensitive.
Filtering is ok.
For example, I have cities like this:
Kosiny
Kosonohy
Košice
Košice - západ
When I filter Kosi, then control filters cities:
Kosiny
Košice
Košice - západ
This is ok, but I can´t type into filter row Kosic, only Kosin.
How can I allow to disable accent in typing into filter row?
Thanks for any idea
Martin
Added By: Stas (DevExpress Support) at: 8/26/2016 7:24:49 AM
Hello,
I've created a separate ticket on your behalf (How to disable accent in typing into a filter row in the E5021 example). It has been placed in our processing queue and will be answered shortly.
'System.InvalidOperationException' en DevExpress.Data.v16.1.dll
Custom function 'RemoveDiacritics' does not implement the ICustomFunctionOperatorConvertableToExpression interface.
Added By: Uriah (DevExpress Support) at: 11/30/2016 5:14:27 AM
Hello David,
I've created a separate ticket on your behalf (T456901: The solution provided in the E5021 ticket throws UnvalidOperationException: Custom function 'RemoveDiacritics' does not implement the ICustomFunctionOperatorConvertableToExpression interface). It has been placed in our processing queue and will be answered shortly.
Hello,
I have created a separate ticket on your behalf (T506001: How to make the auto filter row's filter accent insensitive in version 8.3 (VisualBasic)). I will reply there shortly.
How to convert and then print an ASPxGridView by using the XtraReport
This example demonstrates how to dynamically create a report based upon the ASPxGridView control at runtime. This means that all filtering, sorting and grouping conditions selected in the grid are also applied in a report. To accomplish this task, it is necessary to create a report with all the necessary bands, bind it to a data source and adjust all the necessary options.You can use this approach if you need to display content of templated columns in your report or insert a report based on ASPxGridView to another report.
See also:
E4755: How to convert and then print an GridView extension by using the XtraReport
Question Comments
Added By: Opus 5K at: 9/12/2013 12:01:12 AM
Dear support. I have been trying for several days now to export custom cell templates of a pivotgrid but with no luck. From my previous posts, I understand that the exporting of pivotgrid custom cells is not supported, nor are there any plans to support this in the future. This is a serious shortfall for us and could mean that we are just not able to use your controls if we are not able get the data out to the users.
I then came across this post which appears to be doing exactly what we need to do, although this is doing it against a ASPXGridView and not against a ASPXPivotGrid.
I have been trying to "translate" the C# code so that it instead works off of the ASPXPivotGrid but have not been able to.
Is there any chance that somebody there could provide the equivalent sample that will take a ASPXPivotGrid and create a report out of it which includes the templated cells? As an ideal example, if you are able to show how this code would work against your own templated example found here: http://demos.devexpress.com/aspxpivotgriddemos/Templates/CellTemplates.aspx
I have seen several posts now where users are requesting the ability to export templated cells from the pivotgrid, so I am sure any assistance/sample code you can provide along the same lines as what you have done here will be very useful for quite a few of us.
Thanks in advance
Added By: Andrew L (DevExpress Support) at: 9/12/2013 3:08:43 AMHello,
To export an ASPxPivotGrid control with custom templates use an approach from : http://www.devexpress.com/Support/Center/CodeCentral/ViewExample.aspx?exampleId=E2686 example.
Added By: Cristiano2s at: 2/4/2014 11:18:30 AMHi,
this example works fine and it was very good to my application. But i need the same to excel, and when i did the changes i lost the header. Do you have the same example or just the part to export to excel?
Added By: Vijay Macha at: 5/29/2014 2:51:45 PMHi,
This example is great. Can we export GridviewBand column also in this approach. we are using devexpress 2014 v1.2
In ReportHelper.vb, in InitDetailsandPageheader cell.Text is set to the FieldName where I think it should really be set to the ColumnCaption to make use of the work done in GetColumnsInfo which selects the ColumnCaption to be the Caption if there is one or FieldName if there isn't. It certainly works better for me. This affects C#, VB and the MVC example code.
cell.Width = columns(i).ColumnWidth
cell.Text = columns(i).ColumnCaption 'Better to show the Caption than the examples columns(i).FieldName
row.Cells.Add(cell
I was able to replicate this example, to my needs, but unfortunately there is a problem with the tables label headers, because it does not use the one in the grid caption
How can I change this, since its using the class name, not the grid caption
Hello Jag Zao,
To process your recent post more efficiently, I created a separate ticket on your behalf: T216993: How to convert and then print an ASPxGridView by using the XtraReport + Keep Grid Caption. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.
How to use DashboardExtractDataSource in the ASPxDashboard control
This example demonstrates basic approaches and code snippets that can be used to add a DashboardExtractDataSource to the ASPxDashboard control. The Extract data source is often used if it requires a lot of time to request data from a database using a complex query or a stored procedure. The DashboardExtractDataSource allows you to request this data once and save it in the compressed and optimized form to a file. Then it will be possible to load data from this file and prepare a new file version when data is updated. This concept is described in the Faster Dashboards with the “Data Extract” Source blog.
The following code snippet is used to create a DashboardExtractDataSource and connect it to a DashboardSqlDataSource. Note that I use the CommandTimeout property to increase the query timeout:
[C#]DashboardSqlDataSourcenwindDataSource=newDashboardSqlDataSource("Northwind Invoices","nwindConnection");SelectQueryinvoicesQuery=SelectQueryFluentBuilder.AddTable("Invoices").SelectColumns("Customers.CompanyName","Address","City","Region","PostalCode","Country","Salesperson","OrderDate","Shippers.CompanyName","ProductName","UnitPrice","Quantity","Discount","ExtendedPrice","Freight").Build("Invoices");nwindDataSource.Queries.Add(invoicesQuery);nwindDataSource.ConnectionOptions.CommandTimeout= 600;DashboardExtractDataSourceextractDataSource=newDashboardExtractDataSource("Invoices Extract Data Source");extractDataSource.FileName=GetExtractFileName(path);extractDataSource.ExtractSourceOptions.DataSource=nwindDataSource;extractDataSource.ExtractSourceOptions.DataMember="Invoices";
To add the data source to the ASPxDashboard control use the solution described in the Register Default Data Sources help topic:
[C#]DataSourceInMemoryStoragedataSourceStorage=newDataSourceInMemoryStorage();dataSourceStorage.RegisterDataSource("extractDataSource",GetExtractDataSource(path).SaveToXml());ASPxDashboard1.SetDataSourceStorage(dataSourceStorage);
The UpdateExtractDataSource method is used to extract data from a database. Note that it is impossible to update a used file, thus a new file is always created:
[C#]vards=GetExtractDataSource(path);stringfileName=DateTime.Now.ToString(extractFileName);ds.FileName=path+"Temp\\"+fileName;ds.UpdateExtractFile();
In this example, data is extracted on a button click. However, in a real-life application, this solution can be insufficient (e.g. the site may be deployed to the web farm server). We recommend creating a separate windows service that should update data automatically every hour or every day.
At last, the ConfigureDataConnection event is used to connect the data source to the latest file version:
[C#]protectedvoidASPxDashboard1_ConfigureDataConnection(objectsender,ConfigureDataConnectionWebEventArgse){ ExtractDataSourceConnectionParametersextractCP=e.ConnectionParametersasExtractDataSourceConnectionParameters; if(extractCP!=null){ extractCP.FileName=...; }}
How to use a TemplaeColumn for showing and editing data
This example illustrates how to create a TemplateColumn for working with time values.
How to bind drop-down widgets to a remote ASP.NET Web API service and implement server-side filtering and paging
This example illustrates how to implement remote operations for the dxSelectBox, dxLookup, and dxTagBox widgets if data is obtained from a remote ASP.NET Web API service.
To do this, it is not necessary to implement a custom store manually and you can to create it using the DevExpress.data.AspNet.createStore method implemented in the dx.aspnet.data.js library. This library is a part of the DevExtreme.AspNet.Data data layer extension for ASP.NET MVC. The attached example illustrates how to integrate this library to an MVC 5 application and create a DataSource for the mentioned widgets.
If you need to implement more custom logic, follow the instructions from the dxLookup - Why the "Lookup/byKey callback was not defined" error is thrown when clicking an item if data is loaded from a web service help topic to create a CustomStore instance manually.
Question Comments
Added By: Dominic C at: 4/20/2017 8:02:15 AM Did I miss it or is this mentioned nowhere in the official documentation for data sources?Added By: Alessandro (DevExpress Support) at: 4/20/2017 1:07:06 PM
Hello,
I've created a separate ticket on your behalf (T506473: DataSource documentation). It has been placed in our processing queue and will be answered shortly.
How to provide an end-user with the capability to rename tab headers at runtime in the same manner used in Excel
This example illustrates how to rename tab headers at runtime. To enable this option, it is sufficient to double-click a tab header.
Question Comments
Added By: Joseph Odom at: 4/21/2017 6:00:01 AM I added the else statement to handle situations where Enter key not invoked.
[C#]privatevoidTcMain_MouseDown(objectsender,MouseEventArgse){if(e.Button==MouseButtons.Left&&e.Clicks== 2){XtraTabControltabControl=senderasXtraTabControl;XtraTabHitInfohitInfo=tabControl.CalcHitInfo(e.Location);XtraTabPagetabPage=tabControl.SelectedTabPage;if(hitInfo.HitTest==XtraTabHitTest.PageHeader)SetUpRenameEditor(tabPage);}elserenameEditor.Visible=false;}
Added By: Aleks (DevExpress Support) at: 4/21/2017 7:37:04 AM Hello Joseph,
Thank you for sharing your code with us. I believe that it will be very helpful for other customers.
Select multiple records by clicking them while holding CTRL or SHIFT pressed
UPDATED 10.2+
Starting with version 10.2, the AllowMultiSelection property is deprecated. Use the ASPxGridViewBehaviorSettings.AllowSelectSingleRowOnly property instead. You can see this behavior in our Selection demo.
UPDATED 8.1+
We implemented this behavior out of the box, starting with version 8.1. You can use the SettingsBehavior.AllowMultiSelection property for this.
This demo shows you how to implement multiple record selection without special check boxes. End-users can simply click records while holding CTRL or SHIFT pressed to perform selection operations.
How to create a custom converter to convert the CriteriaOperator to the System.String type
Sometimes the default way of converting CriteriaOperator into System.String is not acceptable. This example demonstrates how to create your own converter by implementing the ICriteriaVisutor and IClientCriteriaVisitor interfaces.
See also: How to delete all criteria corresponding to a particular field from CriteriaOperator
Question Comments
Added By: Ujjawal Kaushik 1 at: 4/24/2017 3:48:02 AM Hi ,when i am using the below code i am getting error in the below line
ICriteriaVisitor<string>, IClientCriteriaVisitor<string>
The non-generic type DevExpress.Data.Filtering.ICriteriaVisitor Can not be used with type argument s.
Can you explain what's the problem with this Added By: Uriah (DevExpress Support) at: 4/24/2017 5:34:30 AM
Hello Ujjawal,
I've created a separate ticket on your behalf (T507368: The non-generic type DevExpress.Data.Filtering.ICriteriaVisitor Can not be used with type arguments). It has been placed in our processing queue and will be answered shortly.
How to login to Twitter, Google and Facebook using OAuth
The DevExpress OAuth Library was designed to help you consume standard OAuth 1.0 and OAuth 2.0 services with ease. This sample demonstrates how to login to some of the most popular services that use OAuth for authentication.
Twitter:OAuth FAQ on Twitter
Google:Authentication and Authorization for Google APIs
Facebook:Authentication with OAuth 2.0
Question Comments
Added By: joel orozco at: 4/24/2017 7:39:03 AM Español
-------------------------------------------------------------------------------------------------------------
hola buen dia
e usado su ejemplo como guia y me ayudo mucho con facebook y twiter pero en google no esta funcionando
al parecer el protocolo OAUTH en google es diferente pero no logro que funcione
la clase donde falla es AuthenticationService.cs
y esta es la linia :
using (WebResponse response = authrequest.GetResponse()) {
INGLES
------------------------------------------------------------------
Hi good dayI used your example as a guide and helped me a lot with facebook and twiter but google is not working
Apparently the OAUTH protocol in google is different but I did not make it work
The class where it fails is AuthenticationService.cs
And this is the line:
Using (WebResponse response = authrequest.GetResponse ()) {
Added By: Michael (DevExpress Support) at: 4/24/2017 8:43:47 AM @Joel: I've created a separate ticket to discuss your question (T507499: Google OAuth solution demonstrated in E20020 doesn't work). It has been placed in our processing queue and will be answered shortly.
Web Dashboard - How to remove Items or Groups from the Toolbox
Web Dashboard - How to implement the Save As and Delete functionality by creating custom extensions
This functionality is implemented by creating custom extensions with the approach from T466716: Web Dashboard - How to work with extensions.
To learn more about extensions, see Working with Extensions.
TextEdit - The password entry box with a strength bar
This example demonstrates how to create the TextEdit descendant which shows strength of the entered password. The password strength is calculated basing on following conditions: password length, does it contains lower or uppercase letters, numbers and other symbols.
Question Comments
Added By: Danny Joe at: 4/25/2017 7:44:55 PM The example swallows the EditValueChanged event of the inherited TextEdit control because it doesn't propagate it by invoking the overridden method in the base class. If you want to use this example code in our own app, be sure to add it back as shown here:
[C#]protectedoverridevoidOnEditValueChanged(){this.RefreshVisualLayout();base.OnEditValueChanged();}