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

How to enter cell edit mode with a single click using DataGridTemplateColumn? #3722

Open
charlesmz opened this issue Nov 8, 2024 · 2 comments
Labels
bug evaluation required Items is pending review or evaluation by the team

Comments

@charlesmz
Copy link

charlesmz commented Nov 8, 2024

Bug explanation

I have used DataGridTemplateColumn, but it doesn't enter edit mode with a single click like DataGridTextColumn does. How can I implement this feature?

<DataGridTemplateColumn Width="200" Header="{localization:Localize param_lab_pressurerange}">
    <DataGridTemplateColumn.CellTemplate>
        <DataTemplate>
            <TextBlock Style="{StaticResource MaterialDesignDataGridTextColumnStyle}" Text="{Binding Value}" />
        </DataTemplate>
    </DataGridTemplateColumn.CellTemplate>
    <DataGridTemplateColumn.CellEditingTemplate>
        <DataTemplate>
            <TextBox
                Style="{StaticResource MaterialDesignDataGridTextColumnEditingStyle}"
                Text="{Binding Value}" />
        </DataTemplate>
    </DataGridTemplateColumn.CellEditingTemplate>
</DataGridTemplateColumn>

Thanks

Version

4.5.0

@charlesmz charlesmz added bug evaluation required Items is pending review or evaluation by the team labels Nov 8, 2024
@JLdgu
Copy link
Contributor

JLdgu commented Nov 8, 2024

The <DataGridTemplateColumn> is normally used for things like buttons, for your example above the <DataGridTextColumn> is the preferred option.

This question is not related to MaterialDesignInXAML but is a WPF question and should therefore be asked on somewhere like Stack Overflow

@charlesmz
Copy link
Author

By default, the DataGridTextColumn is only a double click to enter the edit state, I used MaterialDesignInXAML and it can click to enter the edit state, but the DataGridTemplateColumn does not. How can I implement functionality like DataGridTextColumn

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug evaluation required Items is pending review or evaluation by the team
Projects
None yet
Development

No branches or pull requests

2 participants