@page "/"
@using Syncfusion.Blazor.Inputs
@using Syncfusion.Blazor.Buttons
@using System.ComponentModel.DataAnnotations;
<div class="row">
<div style="width:100%;margin:20px;">
<EditForm EditContext="@editContext">
<DataAnnotationsValidator />
<div class="form-group">
<SfTextBox Placeholder="Test Property" FloatLabelType='@FloatLabelType.Always' @bind-Value="model.TestProperty" CssClass="@cssClass" Blur="TestPropertyBlurEvent"></SfTextBox>
<ValidationMessage For="() => model.TestProperty" />
</div>
<SfButton IsPrimary="true" HtmlAttributes="@(new Dictionary<string, object> { { "type", "submit" } })">Save</SfButton>
</EditForm>
</div>
</div>
@code{
private void click()
{
cssClass = "cssclasschag";
}
private Test model;
private EditContext editContext;
private string cssClass { get; set; }
protected override void OnInitialized()
{
model = new Test();
editContext = new EditContext(model);
}
public class Test
{
[Required]
public string TestProperty { get; set; }
}
public void TestPropertyBlurEvent(FocusOutEventArgs args)
{
if (!editContext.Validate())
{
cssClass = "e-error";
}
else
{
cssClass = "e-success";
}
StateHasChanged();
}
} |
<SfCard ID="CardSample">
<CardHeader Title="Debunking Five Data Science Myths" SubTitle="By John Doe | Jan 20, 2018" />
<CardContent Content="Tech evangelists are currently pounding their pulpits about all things AI, machine learning, analytics—anything that sounds like the future and probably involves lots of numbers. Many of these topics can be grouped under the intimidating term data science." />
</SfCard>
<style>
#CardSample {
background-color: aliceblue;
}
</style> |
public void OnActionBegin(ActionEventArgs<OrdersDetails> args)
{
DDLValue1 = args.RowData.ShipCountry;
DDLValue2 = args.RowData.ShipState;
} |