How can I rearrange toolbar commands


https://www.nevron.com/Forum/Topic8849.aspx
Print Topic | Close Window

By usyber - 10 Years Ago
I have a toolbar command where I like to change the position within the toolbar. The following code does not work:

NDiagramCommand cmd = nDiagramCommandBarsManager1.Commander.Commands.GetCommandFromId((int)DiagramCommand.ToggleSnapToGrid);
nDiagramCommandBarsManager1.Commander.Commands.Remove(cmd);
nDiagramCommandBarsManager1.Commander.Commands.Insert(0, cmd);
By Nevron Support - 10 Years Ago
Hello usyber,

You will need to create custom toolbars builder class like the one described in this post.
The only difference is that instead of using Add method to add the command use Insert to insert the command in desired position.

I hope this helps.