-
Notifications
You must be signed in to change notification settings - Fork 49
-
Notifications
You must be signed in to change notification settings - Fork 49
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
Selected item no longer working in 4.0.2 #170
Comments
same problem here |
Try setting the |
Fixed with #171 |
This is fantastic, thanks for the fix. I've downloaded, compiled, and tested this update with 8.0.20 and the selection seems to be working. |
@lendres I tried using 8.0.20 and 4.0.3 and it still doesn't work. I ran the test project and it didn't work either. What did you do differently? |
@HarborIntex Can you check if the problem has been fixed? I updated to 4.0.3 with MAUI 8.0.20 and ItemSelected still doesn't fire |
I downloaded the repo and compiled it. I just tried it by installing 4.0.3 from NuGet and it does seem to be working for me. I tested the sorting and that the selected item was correctly printed to the output window. That is, from the demo, the function in MainViewModel.cs private void CmdTapped(object item)
{
if (item is Team team)
{
Debug.WriteLine($"Item Tapped: {team.Name}");
}
} correctly prints the selected item. I'm not sure what you mean by "ItemSelected still doesn't fire." Is that specific to your code or in the demo app? |
@lendres There is the ItemSelected eventhandler in DataGrid, where the selected item function worked until 4.0.1. Yes RowTappedCommand works but EventHandler ItemSelected does not |
I hooked onto the ItemSelected event and it triggers. If you feel it is not working, I'd suggest posting a separate issue with a minimum working example. |
Sorry got pulled onto another project last week and this sat on the burner. In my code behind of my form I simply have: private void grdPallets_ItemSelected(object sender, EventArgs e) } This worked fine up to 4.0.1 - but no longer. I can change my code to RowTappedCommand - but if the ItemSelected trigger still works - I would prefer to just correct my existing code. |
this test added to make sure that #170 has been fixed.
@HarborIntex I've created 2 unit test cases to make sure its working properly. So far I couldn't reproduce. Please let us know if you can. |
I cannot reproduce it either. I've tested it by hooking it up from both the xaml and code-behind and both work for me. I think it would be best to post a minimum working example where you are having the issue. |
Thanks for testing. |
@symbiogenesis @lendres either of you able to recreate this with Android with my example? I see the "solution" to 176 above was to rollback to .01. I don't want to do that. Can this not be reopened? Again - my example is as simple as you can get and does not work on Android native or Emulator. Windows does work - but I have no need for that. |
@HarborIntex This issue was originally for the selected item which has been fixed and so the issue was closed. I would suggest submitting this as a new issue and including your example for Windows and Android. |
@HarborIntex There were a lot of problems with your sample app. But after correcting all of them, there was still a problem. PR #163 introduced If I remove that gesture recognizer and then run your sample app, then it works. So, for now, until a hotfix is released, I recommend using a project reference to the DataGrid project. And then just remove the following lines from the DataGrid XAML code of this library: <local:DataGridRow.GestureRecognizers>
<TapGestureRecognizer Command="{Binding RowTappedCommand, Source={x:Reference self}}" CommandParameter="{Binding .}" />
</local:DataGridRow.GestureRecognizers> Alternatively, you could stick with 4.0.3 and try to use the RowTappedCommand which is more MVVM-style anyways. |
Here were the biggest errors with your app, for your own future reference:
|
@HarborIntex also you don't need to open another issue, because someone already had opened one that pinpointed the issue |
Works with 4.04 with no changes - thank you! |
I updated by project to the latest stable 4.0.2 and all my grids lost the ability to select items.
After testing and debugging - I downloaded the full 4.0.2 code ZIP and ran the sample and it also is not working in the sample.
Tested with Android local device and emulator.
Anyone else?
The text was updated successfully, but these errors were encountered: