I use the same Grid dialog template for both Update and Add. When updating the <SfCheckBox> works just fine but when using it to add it does not.
<GridEditSettings Dialog=@DialogParams ShowDeleteConfirmDialog="true" AllowAdding="true" AllowEditOnDblClick="true" AllowEditing="true" AllowDeleting="true" Mode="@EditMode.Dialog">
<HeaderTemplate>
@{
<span>@HeaderTitle</span>
}
</HeaderTemplate>
<FooterTemplate>
<SfButton CssClass="btn btn-primary" OnClick=@(() => Save(context as UserDto)) IsPrimary="true">@ButtonTitle</SfButton>
<SfButton OnClick="Cancel">Cancel</SfButton>
</FooterTemplate>
<Template>
@{
var user = (context as UserDto);
if (user.UserId != null)
{
UserRoles = SetUserRoles(user);
}
else
{
UserRoles = new RoleModelDto();
}
<div class="form-row">
<div class="form-group col-md-6">
<SfTextBox ID="username" @
[email protected] Enabled="true" Placeholder="User Name" FloatLabelType="FloatLabelType.Auto" />
</div>
<div class="form-group col-md-6">
<SfTextBox ID="password" @
[email protected] Enabled="true" Placeholder="Password" FloatLabelType="FloatLabelType.Auto" />
</div>
</div>
<div class="form-row">
<div class="form-group col-md-6">
<SfTextBox ID="firstname" @
[email protected] Enabled="true" Placeholder="First Name" FloatLabelType="FloatLabelType.Auto" />
</div>
<div class="form-group col-md-6">
<SfTextBox ID="lastname" @
[email protected] Enabled="true" Placeholder="Last Name" FloatLabelType="FloatLabelType.Auto" />
</div>
</div>
<div class="form-row">
<div class="form-group col-md-6">
<SfMaskedTextBox ID="phone" Mask="(999) 999-9999" @
[email protected] Enabled="true" Placeholder="Phone Number" FloatLabelType="FloatLabelType.Auto" />
</div>
<div class="form-group col-md-6">
<SfTextBox ID="email" @
[email protected] Enabled="true" Placeholder="Email" FloatLabelType="FloatLabelType.Auto" />
</div>
</div>
<div class="form-row">
<div class="form-group col-md-4">
<SfCheckBox @
[email protected] Label="Text Notification" LabelPosition="LabelPosition.After" />
</div>
<div class="form-group col-md-4">
<SfCheckBox @
[email protected] Label="Email Notification" LabelPosition="LabelPosition.After" />
</div>
<div class="form-group col-md-4">
<SfCheckBox @
[email protected] Label="Two Factor" LabelPosition="LabelPosition.After" />
</div>
</div>
<p>Roles</p>
<div class="form-row">
<div class="form-group col-md-4">
<SfCheckBox Name="IsAdmin" ID="isadmin" @
[email protected] Label="Administrator" LabelPosition="LabelPosition.After" />
</div>
<div class="form-group col-md-4">
<SfCheckBox Name="IsCareAdmin" ID="iscareadmin" @
[email protected] Label="Care Admin" LabelPosition="LabelPosition.After" />
</div>
<div class="form-group col-md-4">
<SfCheckBox @
[email protected] Label="Care Giver" LabelPosition="LabelPosition.After" />
</div>
</div>
<div class="form-row">
<div class="form-group col-md-4">
<SfCheckBox @
[email protected] Label="Reports" LabelPosition="LabelPosition.After" />
</div>
<div class="form-group col-md-4">
<SfCheckBox @
[email protected] Label="Office Staff" LabelPosition="LabelPosition.After" />
</div>
<div class="form-group col-md-4">
</div>
</div>
}
</Template>
</GridEditSettings>
The beside working in the update and not add the first three checkbox work just fine in both modes.
I've attached a short video.