Custom Web Part Verb visibility dependant on WebPartManager.DisplayMode

Last post 04-01-2007 7:50 PM by arrdee. 2 replies.

Sort Posts:

  • Custom Web Part Verb visibility dependant on WebPartManager.DisplayMode

    03-28-2007, 9:48 PM
    • Loading...
    • arrdee
    • Joined on 08-23-2006, 2:08 AM
    • Posts 17

    I have a user control that implements a custom web part verb through the IWebActionable interface, and this works perfectly, but i was hoping to hide the verb depending on the current display mode of the page the web part is in. So that the user cannot select the verb in browse mode etc.

     
    something like

    if((this.Page.WebPartManager).DisplayMode == WebPartManager.CatalogDisplayMode)
    {
    add custom verb
    }
    else { do nothing -> verb is not added
    }

    but I cannot access the web part manager from the custom control.

    Any suggestions on how this could be done? Do i have to inherit the IWebPart interface as well?



     

  • Re: Custom Web Part Verb visibility dependant on WebPartManager.DisplayMode

    03-30-2007, 3:38 AM
    Answer
    • Loading...
    • mharder
    • Joined on 11-22-2002, 12:03 PM
    • Redmond, WA
    • Posts 917
    • Moderator
    http://blogs.msdn.com/mharder

    This posting is provided "AS IS" with no warranties, and confers no rights.
  • Re: Custom Web Part Verb visibility dependant on WebPartManager.DisplayMode

    04-01-2007, 7:50 PM
    • Loading...
    • arrdee
    • Joined on 08-23-2006, 2:08 AM
    • Posts 17

    Thats the one i was looking for, thanks mike that's stellar!

    Just chucked the condition in before the initialisation of the custom verbs and it works a charm!

     

Page 1 of 1 (3 items)
Microsoft Communities
Page view counter