Category Archives: EditorZone

WebPart drag and drop

I cannot get the Drag and Drop functionality of Web Parts is to work.  I have a very simple test page with two WebPartZones.  .  In the OnInit method of the code behind I put the page in design mode.  In the first zone I have a textbox.
At runtime the text box renders as a web part.    When I hover over the web part header my mouse pointer changes the ‘move’ pointer, but I cannot drag the item.  I do not see it dragging and the part never moved.

I am using Visual Studio 2010 with IE 8.  I have tried IE8 in compatibility mode and regular mode.  The results are the same.

Here is the markup from my test page:
<form id="form1" runat="server">
    <asp:WebPartManager ID="WebPartManager1" runat="server">

    <asp:WebPartZone ID="LEFT" runat="server">
            <asp:TextBox ID="tb" runat="server" />
    <asp:WebPartZone ID="RIGHT" runat="server">
    <asp:EditorZone ID="EditorZone1" runat="server">

Here is the code behind:
protected override void OnInit(EventArgs e)
    WebPartManager mgr = WebPartManager.GetCurrentWebPartManager(this);
    mgr.DisplayMode = WebPartManager.DesignDisplayMode;

What am I missing?


I'm not sure but try to set the display mode at Page_Load event instead.


You've posted the same thread in forum. Check this:



I am using web parts and when i used propertyGridEditorPart in run time it does not appear although i am putting it in EditorZone and the page is in EditDisplayMode and i choose the Control which I want to Edit, Can Anybody Help me Please. I searched about this and I found that I should make the page in Share mode not in User mode but I did not work with me


See below discussions:


I used this but it only worked with BehaviorEditorPart and it didn't work with PropertyGridEdiorPart. I Do need to use PropertyGridEditorPart but it didn't appear in the page in the RunTime. Can you please help me and tell me what to do exactly

Better if you will refer to the following article below about PropertyGridEditorPart Class

I made everything but all in vain. I still have my problem. The PropertyGridEditorPart DOES NOT appear when I run the page. This is driving me crazy. Can anybody help me???????????

Actually I Find the EditorZone containing the following message

Modify the properties of the Web Part, then click OK or Apply to apply your changes.

 With no Textboxes or labels


I had the same problem. i think u need to create a custom webpart control which inherits from Webpart class and then u need to define atleast one property as [Personalizable] so that property will appear in your propertyGridEditorPart at runtime.. u can try this link for creating custom webpart control.


hope this works for u.. :)

hi u need to make that property [WebBrowsable] so that it will appear in propertyGridEditorPart.

If you post some code.It will be easy to find the problem.

[RESOLVED] How to maintain aspect ration of Height and Width of Web-Part in AppearanceEditorPart.

Is there any way or workaround so that we can maintain aspect ration of Height and Width of Web-Part in AppearanceEditorPart.


When the editing UI is visible, you can see the AppearanceEditorPart control. If you make some changes in the editing UI and click the Apply button, you can use the Display Mode drop-down list to return the page to browse mode and see the full effect of the editing changes.


so that we can maintain aspect ration of Height and Width of Web-Part in AppearanceEditorPart.

You can use CSS to define the layout like this:

<asp:EditorZone runat="server" ID="EditorZone1">
    <asp:AppearanceEditorPart CssClass="EditorPart" ID="epart1" runat="server" />
  <PartTitleStyle CssClass="EditorPartTitle" />
<style type="text/css">

Please check the link below for more information:

Hope this helps.

Thank's for your reply.

I want to set the height and width aspect ration of the Web-Part not the AppearanceEditorPart.So more precisely can we make a AppearanceEditorPart that containts Height and Width TextBoxes where values can be entered in relation with each 9:8 if i increase the height the width should also increase.

Is there any way for doing this.

Thanks's in advance.

[RESOLVED] EditDisplayMode don't appear in combo

Hello mates,


I'm trying to show all the web part display mode in a combo.

I've added the editorzone,webpartmanager and my webparts.

The problem is that in the combo only appears the BrowseDisplayMode.

 Here is the html code:

<form id="form1" runat="server">
    <asp:WebPartManager ID="WebPartManager1" runat="server">
        <Personalization Enabled="true" />
    <div style="width: 700px">
      <asp:WebPartZone ID="WebPartZoneTop" runat="server"
        HeaderText="Top Zone" style="width: 700px; height: auto">
            <uc1:MyCalendar ID="Calendar1" runat="server"/>
      <div style="width: 395px; float: right; height: auto; padding-left: 5px">       
        <asp:DropDownList ID="ddl_ListMode" runat="server" AutoPostBack="true"
        <asp:EditorZone ID="editor1" runat="server">
                <asp:AppearanceEditorPart Runat="server" ID="AppearanceEditorPart1" />
      <asp:WebPartZone ID="WebPartZoneBottom" runat="server"
        HeaderText="Bottom Zone" style="width: 700px; height: auto;">

And here is part of the code behind:

protected void Page_Init(object sender,EventArgs e)
        Page.InitComplete += new EventHandler(GenerateModeList);

    protected void GenerateModeList(object sender,EventArgs e)
        WebPartManager objWebPartManager = WebPartManager.GetCurrentWebPartManager(Page);
        string sBrowseMode = WebPartManager.BrowseDisplayMode.Name;

        foreach (WebPartDisplayMode objWebPartDisplayMode in objWebPartManager.SupportedDisplayModes)

            //Only BrowseDisplayMode is enabled, I don't know why
                ddl_ListMode.Items.Add(new ListItem(objWebPartDisplayMode.Name, objWebPartDisplayMode.Name));
        ListItemCollection objListItemCollection = ddl_ListMode.Items;

        ddl_ListMode.SelectedValue = ddl_ListMode.Items.FindByText(objWebPartManager.DisplayMode.Name).Value;

Just rememberring, the aspnetdb is hosted in sql server 2008.

Any help would be great.




Hi agusayala,

I have tested the code you provided locally.However,EditDisplayMode can appear in combo according to your code. The issue can't be reproduced.

In order to resolve your issue, please do it as follows:

1.Please check the configuration in the Web.config.

2. Make use of IE Develop Tools to debug the project.

 If I have anything misunderstood, please let me know.Thank you for your help.