Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
150993 | Jan 27,2020 02:21 PM UTC | Jan 28,2020 01:44 PM UTC | Blazor | 1 |
![]() |
Tags: Grid |
public void ActionBegin(ActionEventArgs<Person> args)
{
if (args.RequestType == Syncfusion.EJ2.Blazor.Grids.Action.Save)
{
. . . . . . .. .
// remove deselected and add new skills
foreach (var s in newSkills)
{
p.Skills.Add(new PersonToSkill() { SkillId = s });
}
foreach (var s in removedSkills)
{
p.Skills.RemoveAll(x => x.SkillId == s);
}
if (indexOfPerson != -1)
{
Persons[indexOfPerson] = res;
Helpers.Dump(Persons[indexOfPerson].Skills, "Skills after edit");
this.Grid.DataSource = Persons;
this.Grid.Refresh();
}
|
public void OnBegin(ActionEventArgs<Person> Args)
{
if(Args.RequestType == Syncfusion.EJ2.Blazor.Grids.Action.Save)
{
. . . . . . . . .. . .
foreach (var s in newSkills)
{
//add the changes directly yo event arguments proeprty
Args.Data.Skills.Add(new PersonToSkill() { Id = s, Skill = SkillList.Where(X=>X.Id == s).FirstOrDefault().Skill });
}
foreach (var s in removedSkills)
{
//like wise while removing also modify the changes in argument proeprties
Args.Data.Skills.RemoveAll(x => x.SkillId == s);
}
}
} |
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.