Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DataGridNumericUpDownColumn - Vertical alignment #3470

Closed
pavelkocich opened this issue Mar 7, 2019 · 0 comments · Fixed by #3485
Closed

DataGridNumericUpDownColumn - Vertical alignment #3470

pavelkocich opened this issue Mar 7, 2019 · 0 comments · Fixed by #3485
Labels
Milestone

Comments

@pavelkocich
Copy link

pavelkocich commented Mar 7, 2019

I want to make NumericUpDown in DataGrid column to be aligned to top, like my other columns. I have tried to set VerticalAlignment and VerticalContentAlignment to Top in ElementStyle and EditingElmentStyle, but without success.

<Style x:Key="DataGridNumericUpDownColumnEditingElementStyle" TargetType="Controls:NumericUpDown" BasedOn="{StaticResource NumericUpDown}">
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="Padding" Value="0"/>
        <Setter Property="VerticalAlignment" Value="Top"/>
        <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled"/>
        <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Disabled"/>
        <Setter Property="VerticalContentAlignment" Value="Top"/>
        <Setter Property="MinHeight" Value="0"/>
    </Style>

    <Style x:Key="DataGridNumericUpDownColumnElementStyle" TargetType="Controls:NumericUpDown" BasedOn="{StaticResource NumericUpDown}">
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="VerticalAlignment" Value="Top"/>
        <Setter Property="IsHitTestVisible" Value="False"/>
        <Setter Property="Focusable" Value="False"/>
        <Setter Property="HideUpDownButtons" Value="True"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled"/>
        <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Disabled"/>
        <Setter Property="VerticalContentAlignment" Value="Top"/>
        <Setter Property="MinHeight" Value="0"/>
        <Setter Property="Controls:ControlsHelper.DisabledVisualElementVisibility" Value="Collapsed"/>
    </Style>

<ma:DataGridNumericUpDownColumn Header="Number" Binding="{Binding Number}" ElementStyle="{StaticResource DataGridNumericUpDownColumnElementStyle}" EditingElementStyle="{StaticResource DataGridNumericUpDownColumnEditingElementStyle}"/>

mahhappsdatagridnumericupdowncolumn

@punker76 punker76 added this to the 2.0.0 milestone Apr 16, 2019
@punker76 punker76 added the Bug label Apr 16, 2019
punker76 added a commit that referenced this issue Apr 16, 2019
…UpDownColumn-Styles

(GH-3470) Fix for: DataGridNumericUpDownColumn - Vertical alignment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging a pull request may close this issue.

2 participants