-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Button Command doesn't getting executed in DataGridTemplateColumn #4924
Comments
Hello Reza-Noei, thank you for opening an issue with us! I have automatically added a "needs triage" label to help get things started. Our team will analyze and investigate the issue, and escalate it to the relevant team if possible. Other community members may also look into the issue and provide feedback 🙌 |
This issue has been marked as "needs attention 👋" due to no activity for 15 days. Please triage the issue so the fix can be established. |
I am facing the exact same issue when using buttons and commands in a DataGridTemplateColumn. And when I use the Button's click event, everything works fine. |
I also faced the same issue where the button command was not invoked. Found a workaround solution for this. Workaround Solution :
Attached Property :
In Xaml,
Hope it helps! |
Thanks @AkilanRagavaswamy . This works! |
Thanks @AkilanRagavaswamy too ! This works very good! |
Describe the bug
I have a DataGrid defined as below:
As you can see, I have two button with commands
EditTestCommand
andDeleteTestCommand
. These commands aren't working when user clicks on those buttons.I can use Button's click event instead. But I don't know why
Commands
aren't working.and TestModel contains:
As I mentioned in the Xaml Click event works for buttons but Commands aren't working at all.
In my
Page
class I have a property of TypePageViewModel
(namedViewModel
) which contains anObservableCollection
of typeTestModel
Regression
"CommunityToolkit.WinUI.UI.Controls.DataGrid" Version="7.1.2"
Reproducible in sample app?
Steps to reproduce
Expected behavior
I expected to see button commands working.
Screenshots
No response
Windows Build Number
Other Windows Build number
No response
App minimum and target SDK version
Other SDK version
No response
Visual Studio Version
2022
Visual Studio Build Number
17.6.2
Device form factor
Desktop
Nuget packages
Additional context
No response
Help us help you
Yes, but only if others can assist.
The text was updated successfully, but these errors were encountered: