content query web part - SharePoint 2007 public override ToolPart[] GetToolParts() bug? -


in custom content query web part following code works. i'm able change web part title , toolpart title:

public class customwebpart1 : contentbyquerywebpart {     public override toolpart[] gettoolparts()     {         toolpart[] toolpartarray = base.gettoolparts();         return new toolpart[] { new customcontentquerywebparttoolpart(), toolpartarray[0], toolpartarray[1] };     } }  public class customcontentquerywebparttoolpart : toolpart {     textbox txt1;     customwebpart1 wp;      public customcontentquerywebparttoolpart()     {         this.title = "my custom properties";     }      protected override void createchildcontrols()     {         txt1 = new textbox();         this.controls.add(txt1);          base.createchildcontrols();     }      public override void applychanges()     {         this.title = "toolpart title: " + txt1.text;          wp = this.webparttoedit customwebpart1;          wp.title = "webpart title: " + txt1.text;          base.applychanges();     } } 

enter image description here

but if change position in array (which display order of web part properties) changing web part title doesn't work anymore!

    public override toolpart[] gettoolparts()     {         toolpart[] toolpartarray = base.gettoolparts();         return new toolpart[] { toolpartarray[0], toolpartarray[1], new customcontentquerywebparttoolpart() };     } 

enter image description here

what's wrong here? bug? changing toolpart title still works.


Comments

Popular posts from this blog

matlab - Deleting rows with specific rules -

jquery - How would i go about shortening this code? And to cancel the previous click on click of new section? -