RowDrop Event
Fired when drag and drop operation is triggered from the client
Event Parameters
-
(object)
sender- The control that fires the event
-
(GridDragDropEventArgs)
e-
Event arguments
-
(GridDataItem)
e.DestDataItemGets the destination
GridDataItem
if the row have been dropped over a data item. -
(RadGrid)
e.DestinationGridGets the
RadGrid
in which a row have been dropped. -
(GridTableView)
e.DestinationTableViewContains
GridTableView
instance to which belongs the destination item. -
(IList<GridDataItem>)
e.DraggedItemsGets a collection of all
GridDataItem
dragged items. -
(GridItemDropPosition)
e.DropPositionGets the position aw which the user had dragged and dropped the source item(s) with regards to the destination item.
-
(string)
e.HtmlElementGets the HTML element id attribute of the element on which the row have been dropped.
-
-
Attaching the event
In the Markup
<telerik:RadGrid ID="RadGrid1" runat="server" OnRowDrop="RadGrid1_RowDrop"">
</telerik:RadGrid>
In the Code behind
protected void Page_Init(object sender, EventArgs e)
{
RadGrid1.RowDrop += RadGrid1_RowDrop;
}
The event handler
protected void RadGrid1_RowDrop(object sender, GridDragDropEventArgs e)
{
GridDataItem destinationDataItem = e.DestDataItem;
RadGrid destinationGrid = e.DestinationGrid;
GridTableView destinationTableView= e.DestinationTableView;
IList<GridDataItem> draggedItems = e.DraggedItems;
GridItemDropPosition dropPosition = e.DropPosition;
string htmlElement= e.HtmlElement;
}