RadGrid for ASP.NET AJAX custom drag content extender

Thread is closed for posting
1 posts, 0 answers
  1. Telerik Admin
    Telerik Admin avatar
    1572 posts
    Member since:
    Oct 2004

    Posted 11 Dec 2010 Link to this post


    RadControls for ASP .NET AJAX version

    Q3 2010 and later
    .NET version

    3.5 and later
    Visual Studio version

    2008 and later
    Programming language

    Browser support

    all browsers supported by RadControls for ASP .NET AJAX

    RadGrid for ASP.NET AJAX provides a handy Items Drag-and-Drop functionality that allows you to drag items in or between RadGrid instances. As a visual indication of the dragged items, RadGrid creates copies of the selected items and moves them along with the mouse cursor on mouse move. This project demonstrates how the dragged content attached to the mouse cursor can be customized using an ExtenderControl attached to RadGrid.

    The GridCustomDragExtender control that implements this behavior provides the DragContentTemplate that allows you to define arbitrary content to be shown when grid items are dragged. This content is initially rendered hidden and shown upon dragging items from the RadGrid instance the extender is attached to. The CursorOffsetLeft and CursorOffsetTop properties specify the position of the dragged content relative to the mouse cursor.

    On the client, GridCustomDragExtender fires 2 events: dragContentCreating and drag. You can register event handlers for them through the extender's server-side OnClientDragContentCreating and OnClientDrag properties, respectively. OnClientDragContentCreating is fired each time item drag is started before the custom content specified in DragContentTemplate is shown on the page. In the event handler, you can access the dragged items collection and the content panel that contains your dragged content. This mechanism can be used to set any item-specific data inside the dragged content before it is rendered on the page. OnClientDrag is fired with each mousemove event during item drag.

    The GridCustomDragExtender provides a handy approach for defining and databinding custom drag content when dragging items in RadGrid.
Back to Top

This Code Library is part of the product documentation and subject to the respective product license agreement.