Skip to content
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

366 selecteditem binding is not working in list view #367

Conversation

Sofiya-kumar
Copy link
Collaborator

If selected item is preselecting with dynamic binding its not showing as selected item in UI.

@Sofiya-kumar Sofiya-kumar requested review from rthanga1 and amosekr April 3, 2024 07:19
@Sofiya-kumar Sofiya-kumar linked an issue Apr 3, 2024 that may be closed by this pull request
}
//public new IEnumerable ItemsSource
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we need this?

#endregion
#region Constructor
public TMListView()
{
HasUnevenRows = true;
if (DeviceInfo.Platform == DevicePlatform.WinUI)
{
SetDynamicResource(BackgroundColorProperty, "CellDefaultBackgroundColor");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we have these changes in the other PR as well

switch (SelectionMode)
{
case ListSelectionMode.Multiple:
if (SelectableItems.Contains(e.Item))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you set the SelectedItem to null here?

break;

case ListSelectionMode.Single:
SelectableItems.Clear();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And clear the SelectedItems here?

…mponents into 366-selecteditem-binding-is-not-working-in-list-view
@Sofiya-kumar
Copy link
Collaborator Author

In Android, it works as expected when the default selected item is set and shows the highlighted color. In Windows, it's not working as expected since Itemsource and templetedItems is null

@Sofiya-kumar Sofiya-kumar deleted the 366-selecteditem-binding-is-not-working-in-list-view branch July 3, 2024 04:54
@Sofiya-kumar Sofiya-kumar restored the 366-selecteditem-binding-is-not-working-in-list-view branch July 3, 2024 04:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SelectedItem binding is not working in list view
2 participants