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.
🔥 Join developers growing publicly
Share your knowledge, build in public, and grow your developer presence with a global community.
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
55Posts
203Comments
157Connections
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
- Spanish Educational Video Scriptwriter / Instructional Content DeveloperIdlewild Co · Full time · Charleston, WV
- Full Stack Software Engineer (Components)SpaceX · Full time · Hawthorne, CA
- Retail Sales Associate Spanish BilingualVerizon · Full time · Germany
Commenters (This Week)
GPTImage25Notes
6 comments
TheCodeStreet
1 comment
Avneet
1 comment
Contribute meaningful comments to climb the leaderboard and earn badges!