Spyros Quick thought: have you considered handling updates to the Options list when the parent Name changes at runtime, or is that out of scope for this use case?
Creating a Syncfusion MultiSelect Component with Two-Way Binding in Blazor
2 Comments
Spyros
•
Thanks for the note I really appreciate it. We're all students of learning, after all.
In this case, the Name value remains static throughout the component’s lifecycle, so updating the Options dynamically isn’t necessary. However, you’re absolutely right: if we ever need to support changes to Name at runtime, we should definitely handle it properly.
Here’s one way to achieve that:
private Picklist _previousName;
public override async Task SetParametersAsync(ParameterView parameters)
{
await base.SetParametersAsync(parameters);
if (!EqualityComparer<Picklist>.Default.Equals(_previousName, Name))
{
_previousName = Name;
PicklistService.Refresh();
Options = PicklistService.DataSource
.Where(x => x.Name == Name)
.ToList();
InternalSelectedValues = Options
.Where(x => SelectedValues.Any(s => s.Value == x.Value))
.ToList();
}
}
Please log in to add a comment.
Please log in to comment on this post.
More Posts
- © 2026 Coder Legion
- Feedback / Bug
- Privacy
- About Us
- Contacts
- You Tube
- Tiktok
- Premium Subscription
- Terms of Service
- Early Builders
chevron_left
56Posts
205Comments
165Connections
Passionate about building robust and scalable software solutions with a focus on .NET technologies. ... Show morePassionate about building robust and scalable software solutions with a focus on .NET technologies. With extensive experience in leading teams, designing systems, and mentoring developers, I strive to deliver high-quality, efficient, and maintainable code. I share insights, tutorials, and best practices to help others grow in their software engineering journey. Always eager to learn, explore, and contribute to the tech community
https://www.linkedin.com/in/spyros-ponaris-913a6937/ Show less
https://www.linkedin.com/in/spyros-ponaris-913a6937/ Show less
More From Spyros
Related Jobs
- .Net/Blazor DeveloperThe Timberline Group Company · Full time · Saint Louis, MO
Commenters (This Week)
emilycarter8971
1 comment
ABDULLAH AFZAL
1 comment
brojangles89
1 comment
Contribute meaningful comments to climb the leaderboard and earn badges!