MaterialDesignInXamlToolkit icon indicating copy to clipboard operation
MaterialDesignInXamlToolkit copied to clipboard

I need to control combobox popup height.

Open taehyun1234 opened this issue 1 year ago • 1 comments

In my case,

image

i want to shrink the datagrid combobox like this. image

how i can do like this??

taehyun1234 avatar Feb 06 '24 07:02 taehyun1234

@taehyun1234 I believe you can achieve what you want by adding the following to your combo box column:

<materialDesign:DataGridComboBoxColumn ...>
  <materialDesign:DataGridComboBoxColumn.EditingElementStyle>
    <Style TargetType="ComboBox" BasedOn="{StaticResource {ComponentResourceKey TypeInTargetAssembly={x:Type ComboBox}, ResourceId=MaterialDataGridComboBoxColumnEditingStyle}}" >
      <Style.Resources>
        <Style x:Key="MyComboBoxItemStyle" TargetType="ComboBoxItem" BasedOn="{StaticResource MaterialDesignComboBoxItemStyle}">
          <Setter Property="Padding" Value="0" /> <!-- Set whichever padding you prefer here -->
        </Style>
      </Style.Resources>
      <Setter Property="ItemContainerStyle" Value="{StaticResource MyComboBoxItemStyle}" />
    </Style>
  </materialDesign:DataGridComboBoxColumn.EditingElementStyle>
</materialDesign:DataGridComboBoxColumn>

nicolaihenriksen avatar Feb 12 '24 11:02 nicolaihenriksen

Closed due to no feedback of OP after answer.

MichelMichels avatar Apr 01 '24 21:04 MichelMichels