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
260
Style for ComboEditorTool
posted

Hi,

I'm using a ComboEditorTool and would like it to use my application specific combobox style.

Style comboBoxStyle = this.application.TryFindResource(typeof(ComboBox)) as Style;
comboBox.ComboBoxStyle = comboBoxStyle;

Doing this causes my styled combobox shown inside of the infragistics one. How could I change the apperance of the comboeditortool to fit my style?

Thanks in advance
Stef

Parents
No Data
Reply
  • 54937
    Suggested Answer
    Offline posted

    The ComboEditorTool is a derived xamComboEditor. Like the other editors, the xamComboEditor has a render template (i.e. the default template) and an edit template (the ControlTemplate used while in edit mode). When not in edit mode (i.e. the default state), the control's default template includes elements like a toggle button etc. to look like it will while it is in edit mode. The edit template includes a ComboBox whose style is bound to the ComboBoxStyle property. So setting the ComboBoxStyle is just going to affect the look of the ComboBox hosted within the edit template (i.e. within the control while in edit mode). You can either create a custom template for the default/render template using the default xaml we ship with the product (located in the DefaultStyles directory). Or you could possibly set the IsAlwaysInEditMode property to true but you still may need to tweak the edit template to work best with your template. Note the default style for the ComboBox used within the edit template binds to properties on the containing XamComboEditor via the attached ComboEditor property (e.g. DropDownButtonStyle, MinDropDownWidth, MaxDropDownWidth, etc.)

Children
No Data