Here is this month’s edition of WPF Tips & Tricks and interesting support tickets we answered over the last couple of months. If you would like us to elaborate on any item listed within this post, feel free to comment below or create a new ticket in the DevExpress Support Center.
Tips
- You can easily display SVG images within your DevExpress-powered WPF application. Please review the following document for more information: SVG Images.
- To print/export selected rows in our WPF Data Grid, set the TableView.PrintSelectedRowsOnly property to
true
. - Handle the GridViewBase.InvalidRowException event to customize or disable the error message used when a Data Grid row contains invalid data (Row Validation).
- If you override our templates, you can use our ThemeResource extension in the overridden templates to load theme resources automatically (from the currently applied theme). Please review the following article for more information in this regard: How to find and change an inner DevExpress control template.
- When you dock/undock a panel in our WPF Dock Layout Manager, the child element visual tree is rebuilt. To preserve a logical tree structure and increase the speed of dock/undock operations, you can set the DockLayoutManager.LogicalTreeStructure property to
Optimized
.
Tickets
WPF Data Grid
- Expand a master row when a new item is added using MVVM (T985341)
- Change editor settings for autogenerated columns in code (T985471)
-
Allow pasting more than 65536 rows into Data Grid and Spreadsheet (T978207)
To paste more than 65536 rows, modify the ClipboardSourceFactory.SourcePriority and SpreadsheetClipboardOptions.PasteFormat properties:
ClipboardSourceFactory.SourcePriority = new[] { ClipboardSourceType.XMLSpreadsheet, ClipboardSourceType.Excel, ClipboardSourceType.Csv, ClipboardSourceType.UnicodeText, ClipboardSourceType.Text };
<dxsps:SpreadsheetClipboardOptions PasteFormat="Biff12"/>
- How to create a custom filter editor dialog for the WPF Data Grid Control (T976485)
-
Click anywhere on the row to select it if the selector column is enabled (T979476)
When the selector column is enabled, you can only click within the selector column to select rows. To change this default behavior, use the TableView.RetainSelectionOnClickOutsideCheckBoxSelector property.
- Show selector column's checkboxes only at a specific grouping level (T979447)
-
Grid Control doesn't restore the FilterString correctly if it contains an enum value (T981499)
Use the EnumProcessingHelper.RegisterEnum method to register your enum type.
- Focus the Search box automatically in the column filter popup (T985506)
WPF Scheduler
- Show empty cells for dates with null values in ListView (T982885)
- How to print ListView (T986194)
-
Avoid the "No default constructor" warning if AppointmentsSource is a list of interfaces (T981867)
Handle the DataSource.CreateSourceObject event to create an appointment object instance manually:
void DataSource_CreateSourceObject(object sender, CreateSourceObjectEventArgs e) { if (e.ItemType == ItemType.AppointmentItem) e.Instance = new MyAppointment(); }
-
Emphasize the border between Days in WorkWeekView (T981112)
If the Scheduler is grouped, you can use the GroupSeparatorSize property to increase the width of the line between groups.
Miscellaneous
- Charts - How to define Constant Lines for X-Axis elements in each pane using MVVM (T975988)
- Tab Control - How to add custom content to control boxes and relocate scroll buttons (T980532)
- How to obtain a theme brush in code (T984242)
- Bind ListBoxEdit selected items to a property in ViewModel (T981564)
- TextEdit with a mask for two dates (T981213)
-
How to pass a custom caption to Loading Decorator (T985268)
Assign the LoadingDecorator.SplashScreenDataContext property to specify the Loading Decorator’s DataContext, so you can bind to it in LoadingDecorator.SplashScreenTemplate.
- How to change the FontSize and FontFamily for BarButtonItem (T986296)
And don't forget to check our latest blog post about Automation Testing: UI Automation & Appium Testing Support.