Reputation: 7
Strange error: I am using Mudblazor under C#, and am defining property columns. If I add nothing after the last PropertyColumn in the Column group, I get the "CS1662: Cannot convert anonymous method block to delegate type 'delegate type' because some of the return types in the block are not implicitly convertible to the delegate return type" error, but if it is the last column, all is well. Here's the code:
<MudDataGrid id="TrRunsDataGrid" (etc.)>
<Columns>
<PropertyColumns Property=....
<CellTemplate>
</PropertyColumn
<PropertyColumn Property="x => x.RequestStartDate" Format="d" Title="Start Date" Editable=false />
<PropertyColumn Property="x => x.RequestEndDate" Format="d" Title="End Date" Editable=false />
<PropertyColumn Property="x => x.TotalPaid" Format="c" CellStyle="text-align: end" Title="Total Paid" Sortable=false Editable=false />
(If I end the Columns definition here, all is well. But when I add the following column:)
<TemplateColumn Title="Actions" CellClass="d-flex justify=center">
<CellTemplate>
<TRActionButton id="@($"MudButtonEdit{context.Item.Id}")"
Icon="@Icons.Material.OutLined.Edit"
OnClick="()=>OpenDialog(context.Item)">
Edit
</TRActionButton>
</CellTemplate>
</TemplateColumn>
(I get the CS1662 error!)
</Columns>
What on earth am I doing wrong????
Upvotes: 0
Views: 24