Telerik Forums
UI for Blazor Forum
1 answer
61 views

On my page I have:

<TelerikCheckBox Id="chkBxIncludeChildren"
                 @bind-Value="@chkBxIncludeChildren_isSelected"
                 Title="Check me off to include this in the data!"                                                
                 Class="tooltip-target"
                 OnChange="@chkBxIncludeChildren_OnClick" />

and I put the following at the bottom of the page:

.k-checkbox {
    /* Make the border a little darker than the default */
    border-color: rgba(0, 0, 0, 0.4) !important;
}

The checkboxes box appears just as i want it.

But I now want that for my whole project. This is were I am having an issue my entry in the app.css seems to be ignored and I am not sure why.

App.css:

<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />

    <base href="@MyNavigationManager.BaseUri" />

    <link rel="stylesheet" href="bootstrap/bootstrap.min.css" />

    <link rel="stylesheet" href="MarginAnalysis.styles.css" />
    <link rel="icon" type="image/png" href="favicon.png" />
    <HeadOutlet @rendermode="InteractiveServer" />

    @* Telerik Stuff *@
    <script src="_content/Telerik.UI.for.Blazor/js/telerik-blazor.js"></script>
    <link rel="stylesheet" href="_content/Telerik.UI.for.Blazor/css/kendo-theme-default/all.css" />
    @* Needed for the Telerik 5.0.0 icons! *@
    <link href="https://blazor.cdn.telerik.com/blazor/5.0.0/kendo-font-icons/font-icons.css" rel="stylesheet" type="text/css" />


    <link rel="stylesheet" href="app.css" />
</head>

I put the App.ccs at the end. As far as I understand it that should make it work above teleriks theme css.

What am I missing?

 

Thanks

Deasun.

                
Tsvetomir
Telerik team
 answered on 06 Feb 2025
1 answer
103 views

Whenever I add a TelerkiCheckBox to a page/component the testers complain that they can't see the border of the checkbox so I'm constantly adding the below css to my razor files:

<style>
    .k-checkbox {
        /* Make the border a little darker than the default */
        border-color: rgba(0, 0, 0, 0.4);
    }
</style>

If I add this to my app.css it doesn't get applied.

Is there any way to apply this at a global level?

 

Dimo
Telerik team
 updated answer on 16 Oct 2024
1 answer
135 views

I have a bool property binded in two way to a dialog checkbox.

if i change the check value, the variabile inside the dialog in binded correctly, but the variable binded in the main component in not updated.

 

Check this sample, if i set the check and close the dialog, the parent compoent variable is not updated.

https://blazorrepl.telerik.com/ceuZbwah44LSdBQu06

 

how to solve?

 

Main.Razor

 

@if (IsDialogVisible)
{
   <CheckDialog @bind-CheckValue="CheckValue" OnClose="() => IsDialogVisible = false" />
}
<p>CheckValue is @CheckValue</p>
@code {
    private bool IsDialogVisible {get;set;} = true;
    private bool CheckValue {get;set;}

}

 

CheckDialog.Razor

<TelerikDialog @ref="Dialog" Visible="true" ShowCloseButton="false">
       <DialogContent>
       <TelerikCheckBox @bind-Value="CheckValue" OnChange="() => Dialog.Refresh()" />    
       Check test
       </DialogContent>
     <DialogButtons>
         <TelerikButton OnClick="() => OnClose.InvokeAsync()">Close</TelerikButton>
     </DialogButtons>
</TelerikDialog>
@code {
    private TelerikDialog Dialog {get;set;}
    
    [Parameter]
    public bool CheckValue {get;set;}
    [Parameter]
    public EventCallback<bool> CheckValueChanged {get;set;}
    [Parameter]
    public EventCallback OnClose {get;set;}
}

 

Dimo
Telerik team
 answered on 13 Sep 2024
1 answer
74 views

Hi, I have a object with a collection that I want to bind to checkboxes.

public class JasminUserAdProperties()
{
[Required]
public string Email { get; set; }
[Required]
public string Name { get; set; }

/// <summary>
/// Used for checkboxes
/// </summary>
public List<AdGroupDto> Groups { get; set; } = [];
}

And this is the form / component

@using Zeus.Shared.DTO

<TelerikWindow Width="450px" Centered="true" Visible="@(AdProperties != null)" Modal="true">
<WindowTitle>
<strong>Set Jasmin roles</strong>
</WindowTitle>
<WindowActions>
<WindowAction Name="Close" OnClick="@CancelUpdateJasminRoles"/>
</WindowActions>
<WindowContent>
<TelerikForm Model="@AdProperties" OnValidSubmit="@UpdateJasminRoles">
<FormValidation>
<DataAnnotationsValidator/>
</FormValidation>
<FormItems>
@{
<FormItem>
<Template>
<label for="selectAllCheckbox">Selected All</label>
<TelerikCheckBox Id="selectAllCheckbox"
Value="@SelectAllValue"
ValueChanged="@((bool value) => ValueChanged(value))"
Indeterminate="@SelectAllIndeterminate"/>
</Template>
</FormItem>
foreach (var group in AdProperties.Groups.OrderBy(g => g.Name))
{
<FormItem>
<Template>
<label for="@group.Id">@group.Name</label>
<TelerikCheckBox @bind-Value="@group.Selected" Id="@group.Id" Name="@group.Id"/>
</Template>
</FormItem>
}
}

</FormItems>
<FormButtons>
<TelerikButton Enabled="@CanEdit" ButtonType="ButtonType.Submit" ThemeColor="@ThemeConstants.Button.ThemeColor.Primary">Save</TelerikButton>
<TelerikButton OnClick="@CancelUpdateJasminRoles">Cancel</TelerikButton>
</FormButtons>
</TelerikForm>
</WindowContent>
</TelerikWindow>

@code {

[Parameter] public EventCallback<JasminUserAdProperties> UpdateRoles { get; set; }

[Parameter] public EventCallback CancelUpdateRoles { get; set; }


[Parameter] public JasminUserAdProperties AdProperties { get; set; }

[Parameter] public bool CanEdit { get; set; }


private bool SelectAllValue => AdProperties.Groups.All(eq => eq.Selected);
private bool SelectAllIndeterminate => AdProperties.Groups.Any(eq => eq.Selected);

private void ValueChanged(bool value)
{
AdProperties.Groups.ForEach(eq => { eq.Selected = value; });
}

private void CancelUpdateJasminRoles()
{
if (CancelUpdateRoles.HasDelegate)
{
CancelUpdateRoles.InvokeAsync();
}
}

private void UpdateJasminRoles()
{
if (UpdateRoles.HasDelegate)
{
UpdateRoles.InvokeAsync(AdProperties);
}
}

}

I am getting this error(s) in spades.

blazor.webassembly.js:1  crit: Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]
      Unhandled exception rendering component: Object of type 'Telerik.Blazor.Components.TelerikCheckBox`1[[System.Boolean, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]' does not have a property matching the name 'Name'.
System.InvalidOperationException: Object of type 'Telerik.Blazor.Components.TelerikCheckBox`1[[System.Boolean, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]' does not have a property matching the name 'Name'.
   at Microsoft.AspNetCore.Components.Reflection.ComponentProperties.ThrowForUnknownIncomingParameterName(Type targetType, String parameterName)
   at Microsoft.AspNetCore.Components.Reflection.ComponentProperties.SetProperties(ParameterView& parameters, Object target)
   at Microsoft.AspNetCore.Components.ParameterView.SetParameterProperties(Object target)
   at Telerik.Blazor.Components.Common.TelerikInputBase`1[[System.Boolean, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].SetParametersAsync(ParameterView parameters)
   at Telerik.Blazor.Components.TelerikCheckBox`1[[System.Boolean, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].SetParametersAsync(ParameterView parameters)
   at Microsoft.AspNetCore.Components.Rendering.ComponentState.SupplyCombinedParameters(ParameterView directAndCascadingParameters)


Have been looking at Bind to nested (navigation) properties in complex objects but its not for lists.

What am I doing wrong?

 

 

 

 

 

 

Nadezhda Tacheva
Telerik team
 answered on 27 May 2024
1 answer
66 views

Can we get a Switch and Checkbox theme color property similar to the rest of the components.

😀

 

 

Dorothy
Top achievements
Rank 1
Iron
 answered on 20 May 2024
1 answer
115 views

Hello,

 

I have a grid filterable with one column with FilterMenuType.CheckBoxList. 

I initialize a defaut filter with OnStateInit which work fine. But when I change the filter by selecting "Select all", nothing is return. It only work when I clear the filter first.

I reproduce the issue here : https://blazorrepl.telerik.com/GokJaiFR56kNGYBW07

Am I doing something wrong with the default filter or is it a bug? I can't find anything related.

 

Thanks in advance

Nansi
Telerik team
 answered on 13 May 2024
1 answer
491 views

Hi,

This seems to effect most telerik components, but if for example using a TelerikCheckBox and the ValueChanged event is an async function, then the error boundry wont catch the exception. This works from basic checkboxes or if not using async.

Example:

<div>
    Telerik checkbox (does NOT display any error): <TelerikCheckBox TValue="bool" ValueChanged="@OnCheck" />
</div>

<div>
    Basic checkbox (displays the error): <input type="checkbox" @onchange="@OnCheck" />
</div>

@{
    async Task OnCheck()
    {
        throw new Exception("Something went wrong!");
    }
}

MainLayout:

<ErrorBoundary>
    <ChildContent>
        <div class="page">
            <div class="sidebar">
                <NavMenu />
            </div>

            <main>
                <div class="top-row px-4">
                    <a href="https://learn.microsoft.com/aspnet/core/" target="_blank">About</a>
                </div>

                <article class="content px-4">
                    <TelerikRootComponent>
                        @Body
                    </TelerikRootComponent>
                </article>
            </main>
        </div>
    </ChildContent>
    <ErrorContent>
        ERROR!!!
    </ErrorContent>
</ErrorBoundary>

Dimo
Telerik team
 answered on 14 Feb 2024
1 answer
597 views
How would I create a custom reusable component using Blazor Grid?  I have the following that I'd like to create a component from:

<TelerikGrid    Data="@InitialLendersData"
EditMode="@GridEditMode.Incell"
SelectionMode="@GridSelectionMode.Multiple"
@bind-SelectedItems="@SelectedInitialLenders"
Height="250px"
Width="640px"
OnEdit="@EditInitialLendersHandler"
OnUpdate="@UpdateInitialLendersHandler">
<GridColumns>
<GridColumn Field="@nameof(Lender.IsSelected)" Title="" Width="50px" TextAlign="@ColumnTextAlign.Center" Editable="false">
<Template>
@{
EditedLender = context as Lender;
<TelerikCheckBox @bind-Value="@EditedLender.IsSelected" OnChange="@ChangeSelectedHandler" />
}
</Template>
</GridColumn>
<GridColumn Field="@nameof(Lender.Name)" Editable="false" />
<GridColumn Field="@nameof(Lender.Amount)" Width="160px" DisplayFormat="{0:C2}" TextAlign="@ColumnTextAlign.Right">
<EditorTemplate>
@{
var item = context as Lender;
<TelerikNumericTextBox @bind-Value="@item.Amount" DebounceDelay="0" Min=0 Max=999999999999 Arrows="false" Format="C2" Decimals="2"></TelerikNumericTextBox>
}
</EditorTemplate>
</GridColumn>
</GridColumns>
</TelerikGrid>


How do I pass in the data (InitialLendersData & SelectedInitialLenders) and references to the events (EditInitialLendersHandler, UpdateInitialLendersHandler & ChangeSelectedHandler) from the custom component?  Is this possible? 
Dimo
Telerik team
 answered on 20 Dec 2023
1 answer
271 views
Checkbox shows default tabindex="-1" but would like for users to be able to tab through grid
Dimo
Telerik team
 answered on 19 Oct 2023
1 answer
141 views
The blazor TelerikCheckBox do not implement the Name property as TelerikTextBox do instead.

I need to use it in a native html form to post login values to an action for cookie authentication.

Is there any way to add the name attribute?
Nadezhda Tacheva
Telerik team
 answered on 01 Sep 2023
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?