Telerik Forums
UI for Blazor Forum
0 answers
682 views
After updating from UI for Blazor 4.0.1 to 4.3.0 I'm getting the following error:

Error CS0122	'GridBase<T>.TotalCount' is inaccessible due to its protection level
The closest I have found to get that information is grid.Data.Count() but I am not sure that is the right way. So, here's my question: How to access TotalCount from now on?

Regards.
Twain.

Twain
Top achievements
Rank 2
Iron
Iron
Iron
 asked on 21 Jun 2023
1 answer
520 views

I feel like I'm missing something really simple here.  I want to display an icon with a menu item.  I'm following this example https://docs.telerik.com/blazor-ui/components/menu/icons and want to add the FontIcon.Menu. In the code below, I added the icon to the top level menu item. 

 

@layout TelerikLayout
@inherits LayoutComponentBase
@using Telerik.FontIcons;

<PageTitle>HR Taxonomy Change Management</PageTitle>

<div class="container">
    <div class="border">
        <div class="title">
            Taxonomy Change Management
        </div>
        <div class="login">
            <LoginDisplay />
        </div>
        <div style="height: 80px;">
            <TelerikMenu IconField="@(nameof(MenuItem.Icon))" Data="MenuItems" Orientation=@MenuOrientation.Horizontal></TelerikMenu>
        </div>
    </div>
    <div>
        <article class="content px-4">
            @Body
        </article>
    </div>
</div>

@code{
    public List<MenuItem> MenuItems { get; set; } = new List<MenuItem>();

    public class MenuItem
    {
        public string Text { get; set; }
        public bool Disabled { get; set; }
        public object Icon { get; set; }
        public IEnumerable<MenuItem> Items { get; set; }
    }

    protected override void OnInitialized()
    {
        MenuItems = new List<MenuItem>()
        {
            new MenuItem()
            {
                Text="None",
                Icon="@FontIcon.Menu",
                Items = new List<MenuItem>()
                {
                    new MenuItem {Text = "Home" },
                    new MenuItem {Text = "New Request"},
                    new MenuItem {Text = "Admin"}
                }
            }
        };

        base.OnInitialized();
    }
}

<style>
    #demo-runner {
    height: 400px;
    }
</style>

Hristian Stefanov
Telerik team
 answered on 20 Jun 2023
1 answer
256 views

So I have a grid with a subgrid.

Sometimes the subgrid has enough data rows that it seems to the user the grid is doing nothing when in fact tis still getting ready to display its subgrid contents.

I was wondering if there was a way to show the Loader object when these rows are taking a bit to show up?

Hristian Stefanov
Telerik team
 answered on 20 Jun 2023
1 answer
358 views

Is there a way to disable text selection.

I tried adding this css class 

.disable-selection {
    user-select: none;
}

on the <TelerikGrid/> level but I can still highlight text.

Anthony
Top achievements
Rank 1
Iron
 answered on 19 Jun 2023
1 answer
382 views

Hello.

 

I need to cancel a user selection based on  some criteria.  Any idea?  Example, User choose a new item in the dropdownlist and after check something in OnChange event I want to keep the original selection.

 


                       <TelerikDropDownList Data="@infosEtapeMaitriseCategories"                        
                                         @bind-Value="@CurrentlyEditingEtapeMaitrise.tlkpEtapeMaitriseCategorieId"
                                     TextField="TextField" ValueField="ValueField"
                                     Enabled="@tlkpEtapeMaitriseCategorieIdEnabled"                                             
                                     Width="100%">

 

 

Hristian Stefanov
Telerik team
 answered on 19 Jun 2023
3 answers
456 views

When I try the following I just get the underlining number: 343526.3

<ChartSeriesTooltip Visible="true">
                                <Template>
                                    @(string.Format("{0:C2}", (context.FormattedValue as object)))
                                </Template>
                            </ChartSeriesTooltip>

When I try, I get:

<ChartSeriesTooltip Visible="true">
                                <Template>
                                    @(string.Format("{0:C2}", (context.DataItem as object)))
                                </Template>
                            </ChartSeriesTooltip>

 

I am not sure what I am doing wrong here.

the class tis attached to:

public class MDRevNCostOverTime
        {
            [DisplayFormat(DataFormatString = "{0:C}")]
            public decimal Series1 { get; set; }
            [DisplayFormat(DataFormatString = "{0:C}")]
            public decimal Series2 { get; set; }
        }

 

Nadezhda Tacheva
Telerik team
 answered on 19 Jun 2023
1 answer
386 views

How to disable window resizing (by default, the Window is resizable) of Popup Form Template (GridPopupEditSettings)

(similar to the Resizable="false" property for the TelerikWindow component). 

https://demos.telerik.com/blazor-ui/grid/popup-edit-form-template

 

 

Thank you for the help.


Radko
Telerik team
 answered on 19 Jun 2023
1 answer
160 views

Hi,

 

ist there any "Selected" Event for the Editor? I would like to enable/disable custom Tools, based on Selection, like you do with the add/remove hyperlink button.

 

Thanks

Tsvetomir
Telerik team
 answered on 19 Jun 2023
2 answers
262 views
I have written a small application where our service employees can set icons themselves. I thought it would be quite simple:
Here is a list of the icons I found on Teleriks Site:

https://www.telerik.com/design-system/docs/foundation/iconography/icon-list/

And I have written a guide on how to convert the names to camel case so that

...Enum.TryParse(typeof(FontIcon), function.FontIcon, out font_icon);

works.


In function.FontIcon, the corresponding string is stored. And now a message came back saying:

non-recurrence -> NonRecurrence

is not being displayed. I have checked and indeed, it is not present in the Telerik.FontIcon class.

Is there another source that could be referenced where the icon representation and the text are consistent? Yes I could write a small Page to create a list of all components. But I think it is worth mentioning this issue here. :-) Maybe you could fix the page on the documentation.

I ran in this "problem" using ContextMenuItem
Radko
Telerik team
 answered on 18 Jun 2023
1 answer
187 views

Blazor .Net 7

I have the following TelerikListView.  When the user changes the TelerikTextBox Cidr value I want to handle the ValueChanged event however when I do this, I need to update the underlying model object manually.  I am stuck.  When the TelerikListView is in edit mode, either for a new element or for an existing element I can't figureout how to reference the element correctly in the ValueChanged event handler.  I know I need to update the model manually but I am not sure how.  Any hints?

<TelerikListView Data="@SubnetList" Width="700px" Pageable="true"

                 OnCreate="@CreateHandler" OnDelete="@DeleteHandler" OnUpdate="@UpdateHandler"
                 OnEdit="@EditHandler" OnCancel="@CancelHandler">
    <HeaderTemplate>
        <h2>Subnet List</h2>
        <ListViewCommandButton Command="Add" Icon="@FontIcon.Plus">Add Subnet</ListViewCommandButton>
    </HeaderTemplate>
    <Template>
        <div class="listview-item">
            <h4>@context.Cidr</h4>
            <ListViewCommandButton Command="Edit" Icon="@FontIcon.Pencil">Edit</ListViewCommandButton>
            <ListViewCommandButton Command="Delete" Icon="@FontIcon.Trash">Delete</ListViewCommandButton>
        </div>
    </Template>
    <EditTemplate>
        <div style="border: 1px solid green; margin: 10px; padding: 10px; display: inline-block;">
            <TelerikFloatingLabel Text="CIDR">
                <TelerikTextBox Id="Cidr" ValueChanged="@CidrValueChangedHandler" />
            </TelerikFloatingLabel><br />
            <ListViewCommandButton Command="Save" Icon="@FontIcon.Save">Save</ListViewCommandButton>
            <ListViewCommandButton Command="Cancel" Icon="@FontIcon.Cancel">Cancel</ListViewCommandButton>
        </div>
    </EditTemplate>
</TelerikListView>
@code {
    private List<Models.Subnet> SubnetList = new List<Models.Subnet>();

    protected override async Task OnInitializedAsync() 
        => SubnetList = await SubnetService.GetAllAsync();

    private void CidrValueChangedHandler(string theUserInput)
    {
        // manually update the model here

// calculate subnet properties here to help the user select size the subnet
// correctly by selecting the number of bits in the network side of the mask
// # number of hosts, etc.
    }

    async Task GetListViewData()
        => SubnetList = await SubnetService.GetAllAsync();
}

Yanislav
Telerik team
 answered on 16 Jun 2023
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?