How do I change the specific position of a group or move it up and down among other groups at run-time? I thought of changing the index but it's ready-only. I have OutlookNavigationPane as View Style.
Hello,
There is no nice method or property to set on the ExlorerBarGroups that will allow you to move the groups around. If you would like to see this functionality implemented, please submit a Feature Request for this functionality.
However, there is a way via the ExlorerBar Groups collection to remove and insert a group. This is not the best solution, but it will work. Below is a simple prototype of what I tested. I created a MoveExplorerBarGroups method that takes a group and and index. On the click of a button, I take a group in the ExporerBar and an arbitrary index and call the MoveExplorerBarGroups with that information. Then I take that group and insert it into the specified index using remove and insert methods. This seemed to work ok. I hope this will work for you.
{
}
MoveExplorerBarGroups(this.ultraExplorerBar1.Groups[2], 0);
Thank You! Yes, I had the same solution where i had to put my groups in an array and myBar.Groups.AddRange(myarray).
Hi,
I have come accross this same issue, and the removal and re-adding works great..
Only problem is if the Group is a ControlContainer, then the when the group is removed from the explorer bar, all of the controls within it are removed and disposed of :|
Does anyone know if a request has been made all to simply set the index of a group to achieve this?
In March 2008 an overload of the Groups collection's Remove method was added (to versions 8.1 and later) which allows the caller to specify whether to dispose of the container control. In your case you would specify false for this parameter. Note that the method should be used with caution as you don't want to forego disposal unless you know that the group is still going to be used.
For those of you that are using an older version (I'm using 7.3), you can do this to "reposition" groups with controls in them...
this.explorerBar.Groups.All = new object[0];
// add the new array of repositioned groups here
this.explorerBar.Groups.AddRange(new UltraExplorerBarGroup[ { ..., ..., ..., ...});
this wont destroy the controls in the groups
Thanks,
Andrew
Great.. That did the trick..
We we're running v8.1 and the optional parameter wasn't in there.. But have now upgraded to v8.3 and everything is in order :)
Thanks for your help Brian.