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
465
common toolbar
posted

Hi,

 I am trying to create a common toolbar that I can use in several places.  the probem I am having is that the ComboTool on the bar is not throwing the events i want to pic up and it is reverting to a DropDownlist from a dropdown.

 

Heres how i am doing this

In the constructon of the from cantaning a toolmanager i have

m_saveExportToolBar = new SaveExportToolBar<ReconstructionDesignModelList, ReconstructionDesignModel>();

m_toolbarsManager.Toolbars.Add(m_saveExportToolBar);

 when adding the toolbar the combo gets changed

in the constructor of the toolbar I have

m_selectionCombo = new ComboBoxTool("Selection") {ValueList = new ValueList(0), DropDownStyle = DropDownStyle.DropDown};

m_selectionCombo.SharedPropsInternal.Caption = "Selection";

m_selectionCombo.SharedPropsInternal.Category = "Reconstruction";

m_selectionCombo.ToolValueChanged += SelectionComboOnToolValueChanged;

m_selectionCombo.BeforeToolEnterEditMode += SelectionComboOnBeforeToolEnterEditMode;

m_selectionCombo.AfterToolExitEditMode += SelectionComboOnAfterToolExitEditMode;

 

any ideas?

 

steven Evans

Parents
  • 465
    Suggested Answer
    Offline posted

    removing adding the controls to the toolbar in the constructor and adding this code fixed the issue

     protected override void OnAddedToCollection(KeyedSubObjectsCollectionBase primaryCollection)

    {

        ((ToolbarsCollection)primaryCollection).ToolbarsManager.Tools.AddRange(new ToolBase[] { m_selectionCombo });

      base.OnAddedToCollection(primaryCollection);

      Tools.AddRange(new ToolBase[] { m_selectionCombo });

    }

     

    Think I should be using the PFL but it works for now

Reply Children
No Data