How to Stop Only One Web Part From Moving

Last post 07-01-2009 8:24 AM by ramireddyindia. 3 replies.

Sort Posts:

  • How to Stop Only One Web Part From Moving

    06-29-2009, 9:06 AM
    • Member
      2 point Member
    • roman_kht
    • Member since 02-04-2009, 10:17 AM
    • Posts 7

    Hi, 

    I am about to develop a new website. I have set the DisplayMode property to Design, so that I can move around the web parts. But I don't want the right side web parts to be moved to the center area webzones and vice versa. 


    How can I tackle this problem. Please let me know if further detail is required.


    Regards, 

  • Re: How to Stop Only One Web Part From Moving

    06-29-2009, 11:25 AM
    Answer

    webpart has a property, allowzonechange, set that propert to false for those webparts which you don't wants to move.

    foreach(WebPart wp in WebPartZone1.WebParts)

      wp.AllowZoneChange = false;



    Give a man a fish and you feed him for a day. Teach a man to fish and you feed him forever.
  • Re: How to Stop Only One Web Part From Moving

    07-01-2009, 7:28 AM
    • Member
      4 point Member
    • roman.kht
    • Member since 07-01-2009, 11:22 AM
    • Posts 3

    It is valuable information but my problem is not solved yet.

    What I want is to stop only some webparts to be moved to particular webzones.

    For example, I have 4 zones. I can move 2nd and 3rd webparts to zone 1 but not 4th. Now how to restrict only this 4th webpart from moving there to 1st.

    I hope it's much more clear now.

  • Re: How to Stop Only One Web Part From Moving

    07-01-2009, 8:24 AM
    foreach(WebPart wp in WebPartZone1.WebParts)
    {
       if(wp.Title == "your unwanted move webpart title here")
           wp.AllowZoneChange = false;
    }
    
    
    
    


     

    Give a man a fish and you feed him for a day. Teach a man to fish and you feed him forever.
Page 1 of 1 (4 items)