We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Autoselect first item

Hello! I am trying to use AutoComplete control and I have a problem. The first item is automatically selected when app start. Accordingly, the event handler of the item selection event is triggered.

XAML:
syncfusion:AutoComplete Name="cardAutoComplete" Grid.Row="1" Grid.Column="2" DisplayMemberPath="CardNumber" IsAutoAppend="True" Source="Custom" SelectionMode="Single" CustomSource="{Binding Cards, UpdateSourceTrigger=PropertyChanged}" SelectedValueChanged="AutoComplete_SelectedValueChanged"  Margin="5" CanResizePopup="False"

"Cards" is ObservableCollection:
C#:
private ObservableCollection cards;
public ObservableCollection Cards { get { return cards; } set { cards = value; cards = new ObservableCollection(cards.OrderByDescending(x => x.IsActive).ThenBy(x => x.LocalUser.Name).ToList()); OnPropertyChanged("Users"); OnPropertyChanged("Cards"); } }

I am using OnPropertyChanged("Cards") because I need to assign a reference to another collection object.

How to disable first item autoselection? I want to use this control for searching item.

7 Replies

PB Priyanga Balasubramaniam Syncfusion Team August 15, 2017 06:18 AM UTC

Hi Alexey,

Thank you for using Syncfusion Products.

We have checked the reported issue by creating simple sample based on your code example. But in this sample, first item is not selected at the starting.

Could you please check whether the issue is reproduced with the below sample? Also update us your current Essential studio version. It will help us to proceed further on this.

You can download the sample from the below location.

Sample: 132097


Regards,
Priyanga B


AS Alexey Starkov August 16, 2017 10:28 AM UTC

Yes, your sample works correctly,  issue is not reproduced. I was updated Essential Studio, but it did not change anything. I think I found the source of the problem. I am using AutoComplete control in TabItem of TabControl and first item is automatically selected when I select appropriate TabItem. But if I take the AutoComplete out of the TabControl then everything works fine. How the TabControl can affect the behavior of the AutoComplete?



PB Priyanga Balasubramaniam Syncfusion Team August 17, 2017 12:15 PM UTC

Hi Alexey,

Thanks for your update.

We have checked the issue by using AutoComplete control inside our TabControlExt control and MS TabControl. But we could not reproduce the issue at our end. Please find the sample from the below location.

Sample:132097

Could you please modify this sample to reproduce the issue, it may help us to provide solution at the earliest?

Regards,
Priyanga B



AS Alexey Starkov August 18, 2017 07:40 AM UTC

I was able to reproduce the problem on your example. All works correctly only if the AutoComplete located is in the first tab. See attachment:



Attachment: 132097autoselect_2adaa197.zip


PB Priyanga Balasubramaniam Syncfusion Team August 21, 2017 11:43 AM UTC

Hi Alexey,

Thank you for your update.

We were able to reproduce the issue on our side and we have consider it as an issue. A support incident has been created to track the status of this issue under your account. Please log on to our support website to check for further updates.

https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents  

Regards,
Priyanga B


AS Alexey Starkov August 21, 2017 12:18 PM UTC

Ok, Thank you!



PB Priyanga Balasubramaniam Syncfusion Team August 22, 2017 04:33 AM UTC

Hi Alexey,

We request you to follow the incident for further follow-ups about the issue, which has been created under your account.

Regards,
Priyanga B

Loader.
Up arrow icon