Hi, it si possible have a Hierarchy Grid with editable rows. I'm trying, but it does not work wery well. I thing there is problem with @ref attribute, but I'm not sure. Problem is when i try edit multiple rows. I can work only with row which was edit in last time. The others rows which was edit berfore are frozen and edit buton does not work.
<RadzenGrid @ref="_historyGrid" AllowFiltering="false" FilterCaseSensitivity="FilterCaseSensitivity.CaseInsensitive" AllowPaging="false" PageSize="100"
AllowSorting="false" Data="@_customerHistory" TItem="Customer">
<Template Context="customerItem">
<RadzenGrid @ref="_historyActivityGrid" AllowFiltering="false" AllowPaging="false" AllowSorting="false" Data="@customerItem.Activities.Where(o=> o.EndDate != null).OrderByDescending(o => o.StartDate)"
TItem="WorkshopActivity" RowUpdate="@OnUpdateRowActivities">
<Columns>
<RadzenGridColumn TItem="WorkshopActivity" Property="Name" Title="Name">
</RadzenGridColumn>
<RadzenGridColumn TItem="WorkshopActivity" Property="StartDate" Title="Start" Width="180px">
<Template Context="item">
@String.Format("{0:dd.MM.yy HH:mm}", item.StartDate)
</Template>
<EditTemplate Context="item">
<RadzenDatePicker Name="StartDate" TValue="DateTime" ShowTime="true" ShowSeconds="false"
HoursStep="1" MinutesStep="10" DateFormat="dd.MM.yy HH:mm"
@bind-Value="@item.StartDate" Style="width:100%" />
</EditTemplate>
</RadzenGridColumn>
<RadzenGridColumn TItem="WorkshopActivity" Property="EndDate" Title="End" Width="180px">
<Template Context="item">
@String.Format("{0:dd.MM.yy HH:mm}", item.EndDate)
</Template>
<EditTemplate Context="item">
<RadzenDatePicker Name="EndDate" TValue="DateTime?" ShowTime="true" ShowSeconds="false"
HoursStep="1" MinutesStep="10" DateFormat="dd.MM.yy HH:mm"
@bind-Value="@item.EndDate" Style="width:100%" />
</EditTemplate>
</RadzenGridColumn>
<RadzenGridColumn TItem="WorkshopActivity" Property="ElapsedTime" Title="Time">
<Template Context="item">
@(item.ElapsedTime != null ? (item.ElapsedTime.Value.TotalHours > 24 ? item.ElapsedTime.Value.ToString(@"dd\:hh\:mm") : item.ElapsedTime.Value.ToString(@"hh\:mm")) : "")
</Template>
</RadzenGridColumn>
<RadzenGridColumn TItem="WorkshopActivity" Property="UnitAmount" Title="Disc. Amount">
<Template Context="item">
@String.Format("{0:C0}", item.UnitAmount)
</Template>
</RadzenGridColumn>
<RadzenGridColumn TItem="WorkshopActivity" Property="Discount" Title="Discount">
<Template Context="item">
@(item.IsPercentageDiscount ?? false ? $"{item.Discount.Value:0}%" : item.Discount.Value.ToString("C0"))
</Template>
</RadzenGridColumn>
<RadzenGridColumn TItem="WorkshopActivity" Property="FinalAmount" Title="Price">
<Template Context="item">
@($"{item.FinalAmount:C0}")
</Template>
</RadzenGridColumn>
<RadzenGridColumn TItem="WorkshopActivity" Property="PayBy" Title="Pay By">
</RadzenGridColumn>
<RadzenGridColumn TItem="WorkshopActivity" Bubble="false" Filterable="false" Sortable="false" TextAlign="TextAlign.Center" Width="250px">
<Template Context="item">
<RadzenButton Click="@(args => Reopen(item.WorkshopActivityId))" Text="Reopen" Icon="arrow_circle_up"></RadzenButton>
<RadzenButton Icon="edit" Click="@(args => EditHistoryActivityRow(item))" />
</Template>
<EditTemplate Context="item">
<RadzenButton Icon="save" Click="@((args) => SaveHistoryActivityRow(item))">
</RadzenButton>
<RadzenButton Icon="cancel" ButtonStyle="ButtonStyle.Secondary" Click="@((args) => CancelHistoryActivityEdit(item))">
</RadzenButton>
</EditTemplate>
</RadzenGridColumn>
</Columns>
</RadzenGrid>
</Template>
<Columns>
<RadzenGridColumn TItem="Customer" Property="FullName" Title="Customer">
<Template Context="item">
<RadzenLink Text="@item.FullName" Path="@($"/Customers/Customer/{item.CustomerId}?selectedtab=Activities")" />
</Template>
</RadzenGridColumn>
<RadzenGridColumn TItem="Customer" Property="IsSubscriber" Title="Is Subscriber">
</RadzenGridColumn>
<RadzenGridColumn TItem="Customer" Property="RemainingCredit" Title="Remaining Credit">
<Template Context="item">
@String.Format("{0:C0}", item.RemainingCredit)
</Template>
</RadzenGridColumn>
<RadzenGridColumn TItem="Customer" Property="Activities.FinalAmount" Title="Final Price">
<Template Context="item">
@(@String.Format("{0:C0}", item.Activities.Sum(o=> o.FinalAmount)))
</Template>
</RadzenGridColumn>
<RadzenGridColumn TItem="Customer" Property="PayBay" Title="Pay By">
<Template Context="item">
@(item.Activities.Any(o => o.PayBy == PayBy.Money) ? $"{PayBy.Money}" : item.Activities.Any(o => o.PayBy == null) ? $"": $"{PayBy.Credit}")
</Template>
</RadzenGridColumn>
<RadzenGridColumn TItem="Customer" Bubble="false" Filterable="false" Sortable="false" TextAlign="TextAlign.Left">
<Template Context="item">
<RadzenButton Icon="attach_money" Click="@(args => CustomerPay(item))" Text="Pay" Visible="@(item.Activities.Any(o => o.PayBy == null && o.EndDate != null))">
</RadzenButton>
</Template>
</RadzenGridColumn>
</Columns>