|
<SfGrid @ref="Grid" DataSource="@Plants">
<GridEvents OnActionComplete="OnActionCompletedHandler" TValue="PlantModel"></GridEvents>
<GridEditSettings AllowEditing="true" AllowDeleting="true" ShowConfirmDialog="true" Mode="EditMode.Normal" />
<GridTemplates>
<RowTemplate>
@{
var plant = (context as PlantModel);
<td>
<table>
<tbody>
<tr>
<td>
<SfMultiSelect TValue="List<int>" TItem="PlantTechnicalFeaturesAndStructureModel" DataSource="@plantTechnicalFeaturesAndStructures"
Mode="@VisualMode.CheckBox" ShowDropDownIcon="true" ShowSelectAll=true AllowFiltering="true"
SelectAllText="DropdownSelectAll" UnSelectAllText="DropdownUnSelectAll" Placeholder="PlaceHolderPlantTechnicalFeaturesAndStructures">
<MultiSelectFieldSettings Text="MemberName" Value="PlantTechnicalFeaturesAndStructuresId"></MultiSelectFieldSettings>
<MultiSelectEvents TValue="List<int>" TItem="PlantTechnicalFeaturesAndStructureModel" ValueChange="@((args)=>OnPlantTechnicalFeaturesAndStructuresChanged(args,plant))"></MultiSelectEvents>
</SfMultiSelect>
</td>
</tr>
</tbody>
</table>
</td>
}
</RowTemplate>
</GridTemplates>
</SfGrid>
@code {
SfGrid<PlantModel> Grid { get; set; }
public List<PlantModel> Plants { get; set; }
private void OnPlantTechnicalFeaturesAndStructuresChanged(MultiSelectChangeEventArgs<List<int>> args, PlantModel plantobject)
{
//var PlantId = plantDais.PlantId of grid's row????????
foreach (var Id in args.Value)
{
// var data = new PlantTechnicalFeaturesAndStructureModel();
}
//SaveModel();
}
|