Drag/drop from CatalogZone

Last post 02-27-2005 11:01 PM by kevindente. 6 replies.

Sort Posts:

  • Drag/drop from CatalogZone

    02-24-2005, 2:35 PM
    • Member
      344 point Member
    • kevindente
    • Member since 12-05-2003, 11:27 AM
    • Posts 75
    In the WSS/SharePoint version of Web Parts, you can drag and drop parts from the catalog to a zone on the page. Is it possible to get this same effect on the Whidbey version of Web Parts? So far I'm not seeing it - you have to add the part by clicking a button, which isn't nearly as cool. ;)
  • Re: Drag/drop from CatalogZone

    02-25-2005, 10:59 PM
    • Contributor
      4,557 point Contributor
    • mharder
    • Member since 11-22-2002, 12:03 PM
    • Redmond, WA
    • Posts 917
    • AspNetTeam
      Moderator
    The CatalogZone and WebPartZone shipping in Whidbey will not support drag and drop from the Catalog, but it is being considered for a future version. You can implement this yourself in Whidbey using a derived CatalogZone and WebPartZone.
    http://blogs.msdn.com/mharder

    This posting is provided "AS IS" with no warranties, and confers no rights.
  • Re: Drag/drop from CatalogZone

    02-26-2005, 4:51 AM
    • Member
      344 point Member
    • kevindente
    • Member since 12-05-2003, 11:27 AM
    • Posts 75
    Yeah, I'd pretty much come to this conclusion. Thanks for confirming it.

    Any pointers are what I would need to override to add this functionality?
  • Re: Drag/drop from CatalogZone

    02-26-2005, 5:00 AM
    • All-Star
      29,644 point All-Star
    • Fredrik N
    • Member since 06-22-2002, 5:03 AM
    • Sweden
    • Posts 5,334
    • TrustedFriends-MVPs
    You need to create your own CatalogPartChrome class and a CatalogZone where you override the CreateCatalogPartChrome method and return your won CatalogPartChrome class that will render the parts.

    You also need to create your own WebPartZone where you add your logic that should add the WebPart to the zone you drop it.
    /Fredrik Normén - fredrikn @ twitter

    ASPInsider

    Microsoft MVP, MCSD, MCAD, MCT

    ASPInsiders
    My Blog
  • Re: Drag/drop from CatalogZone

    02-26-2005, 1:29 PM
    • Member
      344 point Member
    • kevindente
    • Member since 12-05-2003, 11:27 AM
    • Posts 75
    Fredrik,
    Thanks for the info.

    I started looking at CatalogPartChrome, to see what it would take to accomplish this. Unfortunately, it looks like not many of the methods are virtual, which means you'd pretty much have to re-implement all of the rendering yourself in order to tweak it. Any idea if that's changing for beta 2? If a method like RenderItem were protected and virtual, it would be super-easy to tweak the rendering without having to totally take control of it.

    Also, on the WebPartZone part of it, I started looking at the client-side JavaScript API that the web part framework uses for drag-drop. Is it considered kosher to call those APIs myself (functions like WebPartManager_InitiateDragDrop), or are they considered private implementation details that may change?

    Kevin
  • Re: Drag/drop from CatalogZone

    02-26-2005, 4:49 PM
    • All-Star
      29,644 point All-Star
    • Fredrik N
    • Member since 06-22-2002, 5:03 AM
    • Sweden
    • Posts 5,334
    • TrustedFriends-MVPs
    You can overload the CatalogPartChrome's RenderCatalogPart method. If you can't in the build you have, I can let your know that it will work in beta 2 ;)
    /Fredrik Normén - fredrikn @ twitter

    ASPInsider

    Microsoft MVP, MCSD, MCAD, MCT

    ASPInsiders
    My Blog
  • Re: Drag/drop from CatalogZone

    02-27-2005, 10:37 PM
    • Member
      344 point Member
    • kevindente
    • Member since 12-05-2003, 11:27 AM
    • Posts 75
    Yes, RenderCatalogPart is virtual in my bulid (Nov 04). My complaint was only that in order to tweak the rendering of a catalog part I need to entirely reimplement it - duplicating over a hundred lines of framework code. Doable, but not as efficient as it could be.
Page 1 of 1 (7 items)