C1AutoComplete selection issue with C1EntityFrameworkCore CursorDataCollection

Posted by: james on 4 October 2024, 3:31 am EST

  • Posted 4 October 2024, 3:31 am EST - Updated 4 October 2024, 3:36 am EST

    Hi

    As advised on a previous forum post, I have been using a cursor data collection for my C1AutoComplete controls. I have also been using a cursor data collection my FlexGrids (I hope that is also correct for flexgrid? please advise.).

    I am using C1EntityFrameworkCoreCursorDataCollection and it has been working well for both my Autocompletes and FlexGrids.

    But it has been broken since version 8.0.20241.872, and is still broken in 8.0.20241.927.

    It works in 8.0.20241.820 and previous versions.

    The issue is if you scroll down a couple of pages of the autocomplete and select an item, it does not select properly.

    • When you click an item after scrolling a couple of pages of items, it does not show it as selected in the box.
    • If you click an item from the first page, it selects correctly.

    If you monitor the SelectedItemChanged event, you can see that it fires twice:

    • once with the item correctly,
    • and then a second time with null.

    I removed all the event handlers to see if something was causing it, but the issue is still there. I reverted to version 8.0.20241.820 and it works.

    Relevent Code Snippets:

    private C1EntityFrameworkCoreCursorDataCollection<Customer>? cursorDataCollectionCustomer;
    private C1AutoComplete<Customer>? autoCompleteCustomer;
    
    
    rfidDbContext = RfidDbContextFactory.CreateDbContext();
    cursorDataCollectionCustomer = new C1EntityFrameworkCoreCursorDataCollection<Customer>(rfidDbContext.Customers.Where(c => c.Inactive == false).OrderBy(a => a.Name));
    
    
    <C1AutoComplete ItemsSource="cursorDataCollectionCustomer" Placeholder="Search by Customer Number or Name" T="Customer"
                    DisplayMemberPath="Name" MinLength="3" ValueMemberPath="CustomerId" Filtering="HandleFiltering"
                    SelectedItemChanged="HandleSelectedItemChanged" IsDropDownOpenChanged="HandleDropDownOpenChanged"
                    Class="c1-drop-down form-control-mycustom" EditorStyle="@("padding: 0px;")"
                    @ref="autoCompleteCustomer">
        <ItemTemplate Context="itContext">
            <span>@itContext.CustomerNumber - @itContext.Name</span>
        </ItemTemplate>
    </C1AutoComplete>

    I’ve placed a couple of screenshots below.

  • Posted 7 October 2024, 6:20 am EST

    Hi,

    I am currently investigating the behaviour that you have mentioned at my end and creating a sample to test the same. I will update you soon about my findings.

    Regards,

    Ankit

  • Posted 7 October 2024, 10:29 pm EST

    Hi Ankit

    Thanks for the update.

    Kind Regards

    James

  • Posted 8 October 2024, 5:05 am EST - Updated 8 October 2024, 5:10 am EST

    Hi James,

    I tested with the latest version 8.0.20241.927 and it seems to be working fine at my end. At my end, the SelectedItemChanged Event is triggered only once and also when clicking the item from dropdown it selects the correct item.

    In the sample, I have used the C1CursorDataCollection as you have mentioned you are using and as suggested by us earlier.

    You could refer to the attached sample that I have tested with. Also, refer to the attached gif that shows the steps I have followed.

    The issue might be specific to the sample or based on your implementation. Could you kindly share us a sample replicating the issue? you could also modify the attached sample and share it with us replicating the issue.

    Regards,

    Ankit

    AutoComplete.zip

  • Posted 8 October 2024, 5:32 am EST

    Hi Ankit

    Thanks for your work creating a sample, but as per my initial message, I am using C1EntityFrameworkCoreCursorDataCollection not C1CursorDataCollection.

    Thanks

    Kind Regards

    James

  • Posted 8 October 2024, 9:06 pm EST - Updated 8 October 2024, 9:14 pm EST

    Hi Ankit

    To help you out, I went ahead and created a sample (attached), .net8, server side, and used inmemory entityframework so you don’t need a DB.

    The symptom is slightly different than my app, which may be something do with the different between in-memory and sql for entityframework, but it is broken, and follows the same version:

    For version 8.0.20241.820 and previous versions it works perfect.

    For version 8.0.20241.872, and 8.0.20241.927 it is broken.

    If you run my sample (currently version 820), open the dropdown, scroll down to product 60 (anything past 50), and click it, it selects correctly.

    If you update my sample to version 872 or 927, open the dropdown, scroll down to any product past #50, and click it, say Product 55, it crashes… sometimes it is a full crash (exception), other times it just selects a blank row. Sometimes the selecteditem event triggers twice.

    With EntityFramework SQL, it is never a full crash, but the event fires twice, once with the item, and the second time without, and it doesn’t select.

    AutoCompleteIssue.zip

    Also, I’m guessing the subject line of the post may be a bit misleading, but there was a limit for length of a single word, so I had to put a space in it. Not sure if the forums can be adjusted to allow longer words for post titles.

  • Posted 9 October 2024, 12:03 am EST

    Hi James,

    Thank you for providing the sample. It has helped us replicate the behavior you mentioned. I’ve noticed that in the latest version, the SelectedItemChanged event is triggered twice with a null value, and an exception is also thrown.

    I’ve escalated this to the development team for further investigation. The internal tracking ID for this is C1XAML-37102. I’ll keep you updated as soon as I have more information from the team.

    As for the forum case, where the subject title is limited to a single word, I will pass along your feedback to the appropriate team.

    Best regards,

    Ankit

  • Posted 9 October 2024, 1:14 am EST

    Thanks Ankit. As mentioned, the behaviour is slightly different when SQL is involved, but I’m guessing it is the same bug.

    Kind Regards

    James

  • Posted 6 November 2024, 1:19 am EST

    Hi

    Any update on this please? It is critical to our application, and I would like to be able to upgrade to the current version.

    Thanks

    James

  • Posted 6 November 2024, 5:30 am EST

    Hi James,

    The devs have confirmed the issue as a bug and are looking into it. I have asked the dev team for an ETA and have shared your urgency with the dev team.

    I will update you once I get a response from the dev team on this.

    Regards,

    Ankit

  • Posted 6 November 2024, 8:02 pm EST

    Hi Ankit

    Thanks for the confirmation. I appreciate the update.

    Kind Regards

    James

  • Posted 7 November 2024, 1:11 am EST

    Hi James,

    The developers have mentioned that the ETA for the issue will be 2024 V2 Hotfix 1 which is expected to be released by the starting of January 2025.

    Further, the devs have also mention that if it fits with your use case, you can use the non-virtual collection/list to solve the issue right now.

    I will let you know when there is further information on this from the dev team.

    Regards,

    Ankit

  • Posted 7 November 2024, 2:16 am EST

    Hi Ankit

    Thanks for the ETA. I’m using the virtual collection because the table has 1000s of entries, and I would prefer it load dynamically rather than all of the data.

    Thanks

    Kind Regards

    James

  • Posted 7 November 2024, 2:30 am EST

    Hi James,

    For your use case, we need to wait for the fix. I will update you once I have an update on this or when the fix is available.

    Regards,

    Ankit

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels