This question is locked. New answers and comments are not allowed.
Hello,
i have the following grid.
Please look at the following line:
i have the following grid.
<%= Html.Telerik().Grid<PersonViewModel>( ) .Name( "Grid" ) .DataKeys( keys => keys.Add( p => p.PersonId ).RouteKey( "physicianId" ) ) .Columns( columns => { columns.Bound( c => c.PersonId ).Width(80); columns.Bound( c => c.FullName ).Width( 250 ); columns.Bound( c => c.Email ).Width( 250 ); } ) .DetailView( details => details.ClientTemplate( Html.Telerik().TabStrip().Name( "TabStrip_<#= PersonId #>" ) .SelectedIndex( 0 ) .Items( items => { items.Add().Text( "Zugeordnet" ).Content( Html.Telerik().Grid<PersonViewModel>() .Name( "Assigned_<#= PersonId #>" ) .Columns( columns => { columns.Bound( c => c.PersonId ).Width( 80 ); columns.Bound( c => c.FullName ).Width( 250 ); columns.Bound( c => c.Email ).Width( 250 ); columns.Bound( c => c.PersonId ).Title( string.Empty ).ClientTemplate( Ajax.ActionLink( "Zuordnung aufheben", "Assign", "MyConroller", new { physicianId = "Parent.PersonId", // PersonId from Parentgrid documentalistId = "<#= PersonId #>", // PersonId from Grid in DetailTemplate isAssigned = false }, new AjaxOptions { OnSuccess = "rebind" }, new { @class = "t-button t-state-default" } ).ToString() ).Width( 80 ); } ) .DataBinding( dataBinding => dataBinding.Ajax() .Select( "_Action", "MyConroller", new { id = "<#= PersonId #>" } ) ) .Pageable() .ToHtmlString() ); }).ToHtmlString() )) .EnableCustomBinding( true ) .Pageable( p => { p.Total( ViewData["total"] != null ? ( int )ViewData["total"] : 0 ); } ) .Sortable() .DataBinding( dataBinding => dataBinding.Ajax().Select( "_MySelect", "MyConroller" )) %>Please look at the following line:
new { physicianId = "Parent.PersonId"
How can i set the PersonId of the ParentRow? Both grids use the same ViewModel therefore the Id properties are named PersonId.
Regards,
Timo