Class DataGridDragDropTarget
A control that enabled drag and drop operations on an Chart.
Inheritance
Implements
Inherited Members
Namespace: System.Windows.Controls
Assembly: OpenSilver.Controls.Data.Toolkit.dll
Syntax
[TemplatePart(Name = "DragContainer", Type = typeof(Canvas))]
[TemplatePart(Name = "DragDecorator", Type = typeof(DragDecorator))]
[TemplatePart(Name = "InsertionIndicator", Type = typeof(Path))]
[TemplatePart(Name = "InsertionIndicatorContainer", Type = typeof(Canvas))]
[TemplatePart(Name = "DragPopup", Type = typeof(Popup))]
public class DataGridDragDropTarget : DragDropTarget<DataGrid, DataGridRow>, IControl, IFrameworkElement, IUIElement, IDependencyObject, IAcceptDrop
Constructors
| Improve this Doc View SourceDataGridDragDropTarget()
Initializes a new instance of the DataGridDragDropTarget class.
Declaration
public DataGridDragDropTarget()
Properties
| Improve this Doc View SourceDataGrid
Gets the ListBox that is the drag drop target.
Declaration
protected DataGrid DataGrid { get; }
Property Value
Type | Description |
---|---|
DataGrid |
Methods
| Improve this Doc View SourceAddItem(DataGrid, Object)
Adds an item to an items control.
Declaration
protected override void AddItem(DataGrid itemsControl, object data)
Parameters
Type | Name | Description |
---|---|---|
DataGrid | itemsControl | The items control. |
System.Object | data | The data to be inserted. |
Overrides
CanAddItem(DataGrid, Object)
Returns a value indicating whether an item can be added to the items control.
Declaration
protected override bool CanAddItem(DataGrid itemsControl, object data)
Parameters
Type | Name | Description |
---|---|---|
DataGrid | itemsControl | The items control. |
System.Object | data | The data to be added. |
Returns
Type | Description |
---|---|
System.Boolean | A value indicating whether an item can be added to the items control. |
Overrides
CanRemove(DataGrid)
Returns a value indicating whether an item can be removed from the items control.
Declaration
protected override bool CanRemove(DataGrid itemsControl)
Parameters
Type | Name | Description |
---|---|---|
DataGrid | itemsControl | The items control. |
Returns
Type | Description |
---|---|
System.Boolean | A value indicating whether an item can be removed from the items control. |
Overrides
CanScroll(DataGrid)
Returns a value indicating whether a given items control can scroll.
Declaration
protected override bool CanScroll(DataGrid itemsControl)
Parameters
Type | Name | Description |
---|---|---|
DataGrid | itemsControl | The items control. |
Returns
Type | Description |
---|---|
System.Boolean | The value indicating whether the given items control can scroll. |
Overrides
ContainerFromIndex(DataGrid, Int32)
Retrieves the item container at a given index.
Declaration
protected override DataGridRow ContainerFromIndex(DataGrid itemsControl, int index)
Parameters
Type | Name | Description |
---|---|---|
DataGrid | itemsControl | The items control. |
System.Int32 | index | The index at which to retrieve the container. |
Returns
Type | Description |
---|---|
DataGridRow | The item container at a given index. |
Overrides
GetItemCount(DataGrid)
Gets the number of items in an items control.
Declaration
protected override int GetItemCount(DataGrid itemsControl)
Parameters
Type | Name | Description |
---|---|---|
DataGrid | itemsControl | The items control. |
Returns
Type | Description |
---|---|
System.Int32 | The number of items in the items control. |
Overrides
GetItemsHost(DataGrid)
Retrieves the items host for a given items control.
Declaration
protected override Panel GetItemsHost(DataGrid itemsControl)
Parameters
Type | Name | Description |
---|---|---|
DataGrid | itemsControl | The items control. |
Returns
Type | Description |
---|---|
Panel | The items host for a given items control. |
Overrides
IndexFromContainer(DataGrid, DataGridRow)
Retrieves the index of an item container.
Declaration
protected override int? IndexFromContainer(DataGrid itemsControl, DataGridRow itemContainer)
Parameters
Type | Name | Description |
---|---|---|
DataGrid | itemsControl | The items control. |
DataGridRow | itemContainer | The item container. |
Returns
Type | Description |
---|---|
System.Nullable<System.Int32> | The index of an item container. |
Overrides
InsertItem(DataGrid, Int32, Object)
Inserts an item into an items control.
Declaration
protected override void InsertItem(DataGrid itemsControl, int index, object data)
Parameters
Type | Name | Description |
---|---|---|
DataGrid | itemsControl | The items control. |
System.Int32 | index | The index at which to insert the item. |
System.Object | data | The data to be inserted. |
Overrides
IsItemContainerOfItemsControl(DataGrid, DependencyObject)
Returns a value indicating whether a container belongs to an items control.
Declaration
protected override bool IsItemContainerOfItemsControl(DataGrid itemsControl, DependencyObject itemContainer)
Parameters
Type | Name | Description |
---|---|---|
DataGrid | itemsControl | The items control. |
DependencyObject | itemContainer | The item container. |
Returns
Type | Description |
---|---|
System.Boolean | A value indicating whether a container belongs to an items control. |
Overrides
ItemFromContainer(DataGrid, DataGridRow)
Gets the item from an item container.
Declaration
protected override object ItemFromContainer(DataGrid itemsControl, DataGridRow itemContainer)
Parameters
Type | Name | Description |
---|---|---|
DataGrid | itemsControl | The items control. |
DataGridRow | itemContainer | The item container. |
Returns
Type | Description |
---|---|
System.Object | The data contained by the item container. |
Overrides
OnContentChanged(Object, Object)
Ensures the content of control is a DataGrid.
Declaration
protected override void OnContentChanged(object oldContent, object newContent)
Parameters
Type | Name | Description |
---|---|---|
System.Object | oldContent | The old content. |
System.Object | newContent | The new content. |
Overrides
| Improve this Doc View SourceOnItemDragStarting(ItemDragEventArgs)
Adds all selected items when drag operation begins.
Declaration
protected override void OnItemDragStarting(ItemDragEventArgs eventArgs)
Parameters
Type | Name | Description |
---|---|---|
ItemDragEventArgs | eventArgs | Information about the event. |
Overrides
RemoveItem(DataGrid, Object)
Removes an item from an items control.
Declaration
protected override void RemoveItem(DataGrid itemsControl, object data)
Parameters
Type | Name | Description |
---|---|---|
DataGrid | itemsControl | The items control. |
System.Object | data | The data to be removed. |
Overrides
ScrollIntoView(DataGrid, DataGridRow)
Scrolls a DataGridRow into view.
Declaration
protected override void ScrollIntoView(DataGrid itemsControl, DataGridRow itemContainer)
Parameters
Type | Name | Description |
---|---|---|
DataGrid | itemsControl | The DataGrid containing the row. |
DataGridRow | itemContainer | The DataGridRow object. |