Question

I have created a web part in SharePoint 2007 which has over 40 controls and I was able to make two different Tool Part classes to hold the different sections of the custom controls. I am converting the part over to SharePoint 2010, and I am having a hard time getting two EditorPartCollection class to work on the same page. How can I have two of these? I am sure it is possible, I am just having a hard time getting this to work. Any help would be appreciated.

 public override EditorPartCollection CreateEditorParts()
    {
        var editor = new ClockEditor
        {
            ID = ID + "_Editor",
            Title = "Custom Clock Editor"
        };
        return new EditorPartCollection(new EditorPart[] { editor });
    }


    public override EditorPartCollection CreateEditorParts()
    {
        var zoneEditor = new ZoneEditor
        {
            ID = ID + "_Editor",
            Title = "Time Zone Editor"
        };
        return new EditorPartCollection(new EditorPart[] { zoneEditor });
    } 
Was it helpful?

Solution

See if this works:

public override EditorPartCollection CreateEditorParts()
{
    var zoneEditor = new ZoneEditor
    {
        ID = ID + "_Editor",
        Title = "Time Zone Editor"
    };
    var editor = new ClockEditor
    {
        ID = ID + "_Editor",
        Title = "Custom Clock Editor"
    };
    return new EditorPartCollection(new EditorPart[] { editor, zoneEditor });
} 
Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top