Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
150874 | Jan 22,2020 04:47 PM UTC | Jan 27,2020 03:59 AM UTC | Blazor | 3 |
![]() |
Tags: Grid |
<EjsGrid DataSource="@Employees" Height="315">
<GridEvents OnActionBegin="OnBegin" TValue="Person"></GridEvents>
.. . . .. . . . . . .
<Template>
@{
var item = (context as Person);
. . .. . . . . .
}
@output
}
}
</Template>
<EditTemplate>
@{
var item = (context as Person);
string output = "";
if (item.Roles != null)
{
for (int i = 0; i < item.Roles.Count; i++)
{
if (item.Roles[i].Childrens != null)
{
output += item.Roles[i].Childrens.Child;
if (i < item.Roles.Count - 1) output += ", ";
}
}
}
<EjsMultiSelect @ref="MultiSelect" TValue="string[]" Value="@output.Split(",")" Placeholder="Roles" DataSource="@RoleList">
<MultiSelectFieldSettings Text="Child" Value="Child"></MultiSelectFieldSettings>
</EjsMultiSelect>
}
</EditTemplate>
. . . . . . . . .. . . ..
</EjsGrid>
@code{
public List<Person> Employees { get; set; }
EjsMultiSelect<string[]> MultiSelect { get; set; }
public List<EmployeeName> Emp { get; set; }
public List<Name> RoleList { get; set; }
public void OnBegin(ActionEventArgs<Person> Args)
{
if(Args.RequestType == Syncfusion.EJ2.Blazor.Grids.Action.Save)
{
Update the values in datasource
Args.Data.Roles[0].Childrens.Child = String.Join(",",MultiSelect.Value);
}
} |
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.