Here are a handful of interesting support questions we received over the last couple of months. We hope this information will be helpful as you explore the capabilities and potential of our WPF product line. Should you have any questions, feel free to comment below. We will be happy to follow up.
WPF Data Grid
- How to show custom text in the Drag Drop Hint (T931944)
See: Drag-and-Drop Hint.
- How to disable Bar Item from RowCellMenuCustomizations for the New Item Row (T931924)
To hide Bar Item for the New Item Row, set its IsVisible property to
False
when the target data row’sRowHandle
equalsGridControl.NewItemRowHandle
. Use DXBinding to do this without implementing a custom converter:xmlns:dxmvvm="http://schemas.devexpress.com/winfx/2008/xaml/mvvm" xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid" ... <dxg:TableView NewItemRowPosition="Top"> <dxg:TableView.RowCellMenuCustomizations> <dxb:BarButtonItem Content="Remove item" IsVisible="{DXBinding Expr='Row.RowHandle.Value != $dxg:GridControl.NewItemRowHandle'}" /> </dxg:TableView.RowCellMenuCustomizations> </dxg:TableView>
- How to only obtain rows that remain after filtering (T932633)
See: VisibleItems.
- How to show correct Filter Dropdown values in a column with a custom CellDisplayTemplate (T935015)
- How to enable masked input in the Search Panel (T932207)
Declare an implicit style for the
ComboBoxEdit
type inside a style forGridSearchControl
. Then, define MaskType and Mask properties:xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors" xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid" ... <Window.Resources> <Style TargetType="dxg:GridSearchControl"> <Style.Resources> <Style TargetType="dxe:ComboBoxEdit"> <Setter Property="MaskType" Value="RegEx" /> <Setter Property="Mask" Value="[0-9a-ZA-Z_]*" /> </Style> </Style.Resources> </Style> </Window.Resources>
- How to show custom text for "Checked" and "Unchecked" in columns with Boolean values (T935542)
See: DisplayTextConverter.
- How to highlight relationships between data rows (T936006)
- How to override Column Band Chooser title (T940863)
To change the default title for the Chooser, use built-in localization strings (see: Localization):
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid" ... <dxg:GridControl.View> <dxg:TableView> <dxg:TableView.RuntimeLocalizationStrings> <dxg:GridRuntimeStringCollection> <dxg:RuntimeStringIdInfo Id="ColumnBandChooserCaption" Value="Band Chooser" /> </dxg:GridRuntimeStringCollection> </dxg:TableView.RuntimeLocalizationStrings> </dxg:TableView> </dxg:GridControl.View>
- How to use grouping in Grid Control bound to ListCollectionView (T918354)
- How to expand/collapse a card on a double click in its header (T930582)
- How to implement Drag and Drop between Grid Control and Master-Detail Grid Control (T930366)
See: DragRecordOver.
- How to support row flashing in the Grid Control (T930376)
WPF Editors
WPF Scheduler
- How to only show Resources with appointments (T938248)
- How to execute a custom command for Scheduler's Ctrl+D shortcut (T934375)
You can use our KeyToCommand for the
PreviewKeyDown
event to execute a custom command for theCtrl+D
key shortcut:xmlns:dxmvvm="http://schemas.devexpress.com/winfx/2008/xaml/mvvm" ... <dxmvvm:Interaction.Behaviors> <dxmvvm:KeyToCommand KeyGesture="Ctrl+D" Command="{Binding DeleteCommand}" EventName="PreviewKeyDown" /> </dxmvvm:Interaction.Behaviors>
- How to highlight a specific date or time in Scheduler (T942273)
See: Time Regions.
WPF Charting
- How to implement sliding custom labels with a different label format based on the current axis scale (T937909)
- How to set ToolTip for chart series legend items (T936758)
- How to combine a histogram bar chart with a normal distribution spline chart in a single chart diagram (T934325)
- How to remove a margin/padding inside our Chart Control (Q313368)
WPF Property Grid
- How to only show headers for properties with ExpandableObjectConverter (T938014)
Use one of these solutions:
- Set HeaderShowMode to
OnlyHeader
.xmlns:dxprg="http://schemas.devexpress.com/winfx/2008/xaml/propertygrid" ... <dxprg:CollectionDefinition HeaderShowMode="OnlyHeader" Type="{x:Type collections:IList}" TypeMatchMode="Extended" />
- Create a custom CellTemplate.
xmlns:dxprg="http://schemas.devexpress.com/winfx/2008/xaml/propertygrid" ... <dxprg:CollectionDefinition Type="{x:Type collections:IList}" TypeMatchMode="Extended"> <dxprg:CollectionDefinition.CellTemplate> <DataTemplate /> </dxprg:CollectionDefinition.CellTemplate> </dxprg:CollectionDefinition>
- Set HeaderShowMode to
- How to support Null values in PropertyGrid editors (T929360)
See: AllowNullInput.
WPF Docking
- How to show the Close button in an active panel in all DocumentGroups (T934503)
- How to specify MDI settings for DocumentPanels at the ViewModel level (T935286)
Define these settings at the ViewModel level and bind DocumentPanel’s properties in the implicit style:
xmlns:dxdo="http://schemas.devexpress.com/winfx/2008/xaml/docking" ... <dxdo:DockLayoutManager.Resources> <Style TargetType="dxdo:DocumentPanel"> <Setter Property="MDILocation" Value="{Binding Location, Mode=TwoWay}" /> <Setter Property="MDISize" Value="{Binding Size, Mode=TwoWay}" /> </Style> </dxdo:DockLayoutManager.Resources>
- How to show AutoHideGroups in a predefined order (T929558)
Other controls
- How to define global DXMessageBoxService (T934870)
You can define DXMessageBoxService as a resource in the
App.xaml
file so that this service can be used globally in your application:xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core" ... <Application.Resources> <dx:DXMessageBoxService x:Key="MessageBoxService"/> </Application.Resources>
var service = ServiceContainer.Default.GetService("MessageBoxService"); service.Show(....);
- How to get SvgImageSource Uri as a string in code (T929345)
- How commands are created for methods with the AsyncCommandAttribute (T930535)
If you’ve come across a WPF-related support ticket that you’d like to share with the rest of the DevExpress community, feel free to share your link in the comments section.