微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Blazorise DataGrid 中的内联编辑

如何解决Blazorise DataGrid 中的内联编辑

基本上我希望所有的 CRUD 方法都是外部的,
所以我设置了 UseInternalEditing=false,定义了 RowInserting 和未达到的外部方法

<DataGrid TItem="AppInstructor"
      EditMode="Blazorise.DataGrid.DataGridEditMode.Inline"
      Editable="true"
      RowInserted="@OnRowInserted"
      UseInternalEditing="false"
      ShowValidationFeedback="true"
      Data="@_instService.GetALL()">
<DataGridCommandColumn TItem="AppInstructor">
    <SaveCommandTemplate>
        <Button Color="Color.Primary" Clicked="@context.Clicked">Save</Button>
    </SaveCommandTemplate>
    <EditCommandTemplate>
        <Button Color="Color.Primary" Clicked="@context.Clicked">Edit</Button>
    </EditCommandTemplate>
</DataGridCommandColumn>
<DataGridColumn TItem="AppInstructor" Field="@nameof(AppInstructor.LastName)" Editable="true" Caption="First Name" Sortable="true">
</DataGridColumn>
<DataGridColumn TItem="AppInstructor" Field="@nameof(AppInstructor.LastName)" Editable="true" Caption="Last Name" Sortable="true">
</DataGridColumn>
@code {

private void OnRowInserted(SavedRowItem<AppInstructor,Dictionary<string,object>> e)
{

}

}

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。