Im我的應用程序使用Syncfusion控件的ASP.NET MVC 5 im。如何從Syncfusion MVC Grid的選定行中獲取列值
這是我的觀點:
@using Reporter.Models
@model List<UsersListViewModel>
@(Html.EJ().Grid<object>("FlatGrid")
.Datasource(Model)
.AllowFiltering()
.FilterSettings(d => d.FilterType(FilterType.Menu))
.AllowSorting()
.ToolbarSettings(toolBar => toolBar.ShowToolbar().ToolbarItems(items =>
{
items.AddTool(ToolBarItems.ExcelExport);
}))
.Columns(col =>
{
col.Field("OrderNumber").HeaderText("Lp.").TextAlign(TextAlign.Left).Width(15).AllowFiltering(false).Add();
col.Field("UserName").HeaderText("Nazwa użytkownika").Width(50).Add();
col.Field("CanReadReports").HeaderText("Dostęp do raportów").Width(40).AllowSorting(false).HeaderTextAlign(TextAlign.Center).Add();
col.Field("IsAdministrator").HeaderText("Administrator").Width(40).AllowSorting(false).Add();
})
.Mappers(map => map.ExportToExcelAction("Account/UserListExportToExcel"))
.AllowSelection()
.SelectionType(SelectionType.Single)
)
<hr/>
<p style="text-align: justify">
@Html.ActionLink("Nowy użytkownik", "Register", "Account",
null,
new { @class = "btn btn-default" }
)
@Html.ActionLink("Usuń użytkownika", "Register", "Account",
new {user = "UserNameToRaplace"}, //here i want UserName from selected row
new { @class = "btn btn-default" }
)
@Html.ActionLink("Zmień hasło", "Manage", "Account",
new { user = "UserNameToRaplace"},
new { @class = "btn btn-default" }
)
</p>
而且我的問題是如何從所選行獲取用戶名和粘貼ActionLink的。