Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1120
How to set separator between two tools
posted

Hi

I want a separator between two tools in the ribbon group(Vertical line between the tools as in Sort & Filter group in the  Data tap in the MicroSoft Excel sheet ). I am setting the InstanceProp .IsFirstInGroup to true, but the separator is not coming between the tools.Someone please help me to solve the above mentioned problem.

Thanks in advance

Regards

Navi 

 

Parents
  • 2077
    Offline posted

    From what I understand, you are trying to set it through code. When a tool is added to a ribbon group, actually a clone is created and that is added. The InstanceProps are not copied to the new object, so you'll need to get the newly created tool and then set the IsFirstInGroup property. What I am doing is to create the tool, set it's properties and the properties in the SharedProps collection, add it to the ribbon group, get the new instance of the tool and set it's InstanceProps' properties:

    // create the tool 

    ButtonTool tool = new ButtonTool("key");

    tool.PropertyX = PropertyXValue; 

    tool.SharedProps.PropertyY = PropertyYValue;

    // add it to the root collection of the UltraToolbarManager 

    toolbarManager.Tools.Add(tool);

    // add it to the tools of the ribbon group and get the new instance 

    tool = ribbonGroup.Tools.AddTool(key);

    // now you can set the instance props

    tool.InstanceProps.PropertyZ = PropertyZValue;

     

    You can find a good example here.

    HTH,

    Emanuel

Reply Children