<SfGrid ID="GridID" @ref="Grid" class="gridcolumnsformat"
TValue="UserModel" DataSource="@Users"
Toolbar="toolbaritems">
<GridEditSettings AllowAdding="true" AllowEditing="true" AllowDeleting="false"
Mode="@EditMode.Dialog"
NewRowPosition="NewRowPosition.Bottom">
<HeaderTemplate>
This is the Header
</HeaderTemplate>
<Template>
@{
@* This does not work - I would expect to work the same as the section below commented with "This Works" *@
<button class="btn btn-primary" type="button" @onclick="@(()=> Clicked())">
@( DialogCollapsed ? "Expand" : "Collapse")
</button>
<div class="@(DialogCollapsed? "collapse": "" )">
<div class="form-group">
<label class="label">Some Controls that will be hidden when collapsed</label>
</div>
</div>
}
</Template>
</GridEditSettings>
<GridColumns>
</GridColumns>
<SfSpinner Visible="false" />
</SfGrid>
@code {
public SfGrid<UserModel> Grid { get; set; }
public void Clicked()
{
DialogCollapsed = !DialogCollapsed;
Grid.PreventRender(false);
}
|