Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

DataViewBase.DropMarkerTemplate Property

Gets or sets the template that defines the drop marker‘s presentation. This is a dependency property.

Namespace: DevExpress.Xpf.Grid

Assembly: DevExpress.Xpf.Grid.v24.2.Core.dll

NuGet Package: DevExpress.Wpf.Grid.Core

#Declaration

public DataTemplate DropMarkerTemplate { get; set; }

#Property Value

Type Description
DataTemplate

A System.Windows.DataTemplate object that defines the drop marker’s presentation.

#Remarks

You can customize the drop marker’s appearance. The image below shows an example of a custom drop marker:

DragDropIndicatorTemplate

View Example: How to Customize the Drop Marker

Specify the DropMarkerTemplate property to customize the drop marker’s appearance. This property defines the drop marker’s template. The binding source for this template is the DropMarkerData class.

The following code sample demonstrates how to change the drop marker’s color and size:

<dxg:TableView AllowDragDrop="True">
   <dxg:TableView.DropMarkerTemplate>
      <DataTemplate>  
         <Grid Margin="0,-3,0,-3" IsHitTestVisible="False">
            <Border Height="6" Background="Orange" BorderBrush="Gray" BorderThickness="1"    
               VerticalAlignment="{Binding Position, Converter={StaticResource dropPositionConverter}}" />
         </Grid>
      </DataTemplate>
   </dxg:TableView.DropMarkerTemplate>
</dxg:TableView>
public class DropPositionConverter : IValueConverter {
   public object Convert(object value, Type targetType, object parameter, CultureInfo culture) {
      return (DropPosition)value == DropPosition.Before ? VerticalAlignment.Top : VerticalAlignment.Bottom;
   }
   // ...
}

In the demonstrated code sample, the DropMarkerData.Position property is used to define how to place the drop marker.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the DropMarkerTemplate property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also