-
Notifications
You must be signed in to change notification settings - Fork 47
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
Can't get commands to work without MVVM #176
Comments
RowTappedCommand is one of the only parts of this library that I've not thought about, as it is a newer feature added by someone else. I think your code looks fine to me, and it shouldn't matter whether you are using MVVM. Although, this control was clearly made with MVVM support in mind. If you fork this repo and then modify the sample project to demonstrate the issue, that might help. Also, make sure you are using the absolute latest version of this library, and the latest MAUI version. |
Thanks, Edward! What about ItemSelected? I couldn’t get that to work either. Any known issues there?
Sent from my iPhone; please excuse any typos
Marc Tanberg
Senior Software Developer, Mother Lode Holding Company
t: 877.958.8485
e: ***@***.***
a: 9087 Foothills Blvd., Ste 700 |
Roseville, CA
95747
…________________________________
From: Edward Miller ***@***.***>
Sent: Sunday, April 28, 2024 9:21:46 PM
To: akgulebubekir/Maui.DataGrid ***@***.***>
Cc: Marc Tanberg ***@***.***>; Author ***@***.***>
Subject: Re: [akgulebubekir/Maui.DataGrid] Can't get commands to work without MVVM (Issue #176)
RowTappedCommand is one of the only parts of this library that I've not thought about, as it is a newer feature added by someone else.
I think your code looks fine to me, and it shouldn't matter whether you are using MVVM. Although, this control was clearly made with MVVM support in mind.
If you fork this repo and then modify the sample project to demonstrate the issue, that might help.
Also, make sure you are using the absolute latest version of this library, and the latest MAUI version.
—
Reply to this email directly, view it on GitHub<https://urldefense.com/v3/__https://github.com/akgulebubekir/Maui.DataGrid/issues/176*issuecomment-2081787214__;Iw!!GJ-AXe61Y--K_EM!4FPDZY8vaziS0Gn4IpUcQ64dunVwY74JLFouJMCIGjmnSUdw3bJmm44dtiAwrWxCiodHhXVXi1rBQWNAlgnQKQ$>, or unsubscribe<https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AKKWRR2UEBV2TA4NKX5OJK3Y7WVDVAVCNFSM6AAAAABG5BM5R2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOBRG44DOMRRGQ__;!!GJ-AXe61Y--K_EM!4FPDZY8vaziS0Gn4IpUcQ64dunVwY74JLFouJMCIGjmnSUdw3bJmm44dtiAwrWxCiodHhXVXi1rBQWPP8iq5QA$>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Another user has been reporting it, but the rest of us cannot replicate it: |
maybe do:
Almost seems like a "works on my machine" type of issue. Which is why I say. But another user experienced a problem with the ItemSelected event, and switching to the RowTappedCommand is what fixed it for them. #173 You could try the reverse of that, and switch to the event. |
Hi Edward, Based on the comments in those other issues that you referred to, I rolled back to version 4.0.1 and the ItemSelected handler works perfectly in that version. Thank you! |
When PR #178 lands, this will probably allow you to update without a problem. |
Excellent grid control, thank you! I'm just having an issue getting RowTappedCommand to fire. I'm not using MVVM, so my view is bound to the code behind with Binding = this.
Here's my grid definition:
<dg:DataGrid x:Name="grdResults" ItemsSource="{Binding Results}" SelectedItem="{Binding SelectedLoanType, Mode=TwoWay}" SelectionMode="Single" RowTappedCommand="{Binding ItemTappedCommand}" x:DataType="local:QualifyResultsView">
And the code behind:
public ICommand ItemTappedCommand { get; set; }
BindingContext = this;
ItemTappedCommand = new Command(ItemTapped);
private void ItemTapped(object item){ }
Are you able to assist? Thanks!
The text was updated successfully, but these errors were encountered: