Blazor server doesn't work at all when AdBlocker is on.
Any workaround?
Good Morning,
I vave this code. I try to create a FluentValdation in TelerikForm, code builts good. When i submit empty form, validations are good(), but the form doesn't show the errors.
<TelerikForm Model="@TriggerDetail" Columns="1" ColumnSpacing="25px" OnValidSubmit="@HandleValidSubmit" EditContext="@EditContext">
<FormValidation>
<FluentValidationValidator Validator="@Validator"></FluentValidationValidator>
</FormValidation>
<FormItems>
<FormGroup LabelText="General Information" Columns="2" ColumnSpacing="15px">
<FormItem Field="@nameof(TriggerDetailModel.Name)" LabelText="@Localizer["JobTrigger_Name"]" Enabled="@Enabled"></FormItem>
<ValidationMessage For="@(() => TriggerDetail.Name)" />
<FormItem Field="@nameof(TriggerDetailModel.Group)" LabelText="@Localizer["JobTrigger_Group"]" Enabled="@Enabled">
<Template>
<label class="k-label k-form-label">@Localizer["JobTrigger_Group"]</label>
<TelerikAutoComplete Data="@ExistingTriggerGroups" @bind-Value="@TriggerDetail.Group" ClearButton="true" Enabled="@Enabled" />
</Template>
</FormItem>
<ValidationMessage For="@(() => TriggerDetail.Group)" />
</FormGroup>
</FormItems>
<FormButtons>
<TelerikButton Icon="caret-alt-to-left" OnClick="@BackStep" ThemeColor="@(ThemeConstants.Button.ThemeColor.Error)">@Localizer["Back"]</TelerikButton>
<TelerikButton ButtonType="ButtonType.Submit" Icon="caret-alt-to-right" ThemeColor="@(ThemeConstants.Button.ThemeColor.Info)">@Localizer["Next"]</TelerikButton>
</FormButtons>
</TelerikForm>
@code{
public TriggerDetailModel TriggerDetail { get; set; } = null!;
public TriggerDetailValidator Validator { get; set; } = new();
private void HandleValidSubmit()
{
var validationResult = Validator.Validate(TriggerDetail);
if (validationResult.IsValid)
{
NextStep();
}
else
{
//Errores
}
}
}
public class TriggerDetailValidator : AbstractValidator<TriggerDetailModel>
{
public TriggerDetailValidator()
{
RuleFor(t => t.Name).NotEmpty();
RuleFor(t => t.Group).NotEmpty();
}
}
Where is the problem?
Thanks
@* Enable the CheckParents parameter and observe the behavior of this setting. *@
<TelerikTreeView Data="@FlatData"
@bind-ExpandedItems="@ExpandedItems"
CheckParents="true"
CheckBoxMode="@TreeViewCheckBoxMode.Multiple"
@bind-CheckedItems="@checkedItems">
<TreeViewBindings>
<TreeViewBinding IdField="Id" ParentIdField="ParentIdValue" TextField="Text" HasChildrenField="HasChildren" IconField="Icon" />
</TreeViewBindings>
</TelerikTreeView>
<div>
Checked items:
<ul>
@if (checkedItems.Any())
{
foreach (var item in checkedItems)
{
var checkedItem = item as TreeItem;
<li>
<span>
<TelerikIcon Icon="@checkedItem.Icon"></TelerikIcon>
</span>
<span>
@(checkedItem.Text)
</span>
</li>
}
}
</ul>
<button @onclick="Clear">clear</button>
</div>
@code {
public IEnumerable<object> checkedItems { get; set; } = new List<object>();
public class TreeItem
{
public int Id { get; set; }
public string Text { get; set; }
public int? ParentIdValue { get; set; }
public bool HasChildren { get; set; }
public string Icon { get; set; }
}
public IEnumerable<TreeItem> FlatData { get; set; }
public IEnumerable<object> ExpandedItems { get; set; } = new List<TreeItem>();
protected override void OnInitialized()
{
LoadFlatData();
ExpandedItems = FlatData.Where(x => x.HasChildren == true).ToList();
}
private void Clear() {
checkedItems = new List<object>();
StateHasChanged();
}
private void LoadFlatData()
{
List<TreeItem> items = new List<TreeItem>();
items.Add(new TreeItem()
{
Id = 1,
Text = "Project",
ParentIdValue = null,
HasChildren = true,
Icon = "folder"
});
items.Add(new TreeItem()
{
Id = 2,
Text = "Design",
ParentIdValue = 1,
HasChildren = true,
Icon = "brush"
});
items.Add(new TreeItem()
{
Id = 3,
Text = "Implementation",
ParentIdValue = 1,
HasChildren = true,
Icon = "folder"
});
items.Add(new TreeItem()
{
Id = 4,
Text = "site.psd",
ParentIdValue = 2,
HasChildren = false,
Icon = "psd"
});
items.Add(new TreeItem()
{
Id = 5,
Text = "index.js",
ParentIdValue = 3,
HasChildren = false,
Icon = "js"
});
items.Add(new TreeItem()
{
Id = 6,
Text = "index.html",
ParentIdValue = 3,
HasChildren = false,
Icon = "html"
});
items.Add(new TreeItem()
{
Id = 7,
Text = "styles.css",
ParentIdValue = 3,
HasChildren = false,
Icon = "css"
});
FlatData = items;
}
}
Hi,
Is there any way to add Footer Template to a column of Grid in blazor by C# code?
I don't see a Class property on the GridColumn object. Is there a way to style a specific column? In my instance, i would like to remove the left border for just 1 of many columsn in the grid.
Thanks in advance.
My app worked on v3.6.1 but when I upgraded to v3.7 I'm getting the error below. It has something to do with the TelerikDatePicker. If I remove the date picker it I don't get the error. Any way I can get around this?
fail: Microsoft.AspNetCore.Components.Web.ErrorBoundary[0]
I need a component that allows the user to enter multiple key-values.
Similar to the "properties" window in Visual Studio.
The challenge is that "value" is object type because values ​​can be of different types.
I wanted to implement this using a Grid component with the InCell editing option.
The problem, however, is the unspecified "value" type...
The edit cell would have to render a different edit component depending on the "value" type.
Do you have any idea how to accomplish this?
My test code:
<TelerikGrid Data=@MyData EditMode="@GridEditMode.Incell">
<GridColumns>
<GridColumn Field=@nameof(TextValue.Text) Title="Text" Editable="false" />
<GridColumn Field=@nameof(TextValue.Value) Title="Value" Editable="true" />
</GridColumns>
</TelerikGrid>
@code
{
TextValue[] MyData = new TextValue[]
{
new TextValue { Text = "test1", Value = "test" },
new TextValue { Text = "test2", Value = false },
new TextValue { Text = "test3", Value = 3 }
};
public class TextValue
{
public string Text { get; set; }
public object Value { get; set; }
}
}
I have attached a screenshot.
I copied documentation from: https://docs.telerik.com/blazor-ui/components/grid/overview#creating-blazor-data-grid
I'm using version 2.24.0 is this why there is no styling?