Telerik Forums
UI for Blazor Forum
1 answer
11 views

Hello Telerik,

In my Blazor Hybrid application, I have a toolbar with a textbox in it; I want to add some hotkeys to it: on pressing Enter, process the textbox value, and in pressing Escape, revert the textbox value to the default.

The problem is with the toolbar. I have this piece of code:

@code {
    private void OnKeyUp(KeyboardEventArgs args)
    {
        Debug.WriteLine("key up: " + args.Code);
    }
}
<TelerikToolBar>
    <ToolBarTemplateItem>
        <div @onkeyup="OnKeyUp" tabindex="-1">
            <TelerikTextBox Value="Some Value" />
        </div>
    </ToolBarTemplateItem>
</TelerikToolBar>

It works perfectly for any pressed key, including Enter - except the Escape key. When I press Escape, the textbox loses focus, and I don't get the keyboard event. I tried the keydown and keypress events, too.

In contrast, when I press Tab, I get the keydown event before the textbox loses focus (but no keyup event).

If I place the textbox directly on the page, without the toolbar, the keydown and keyup events work correctly, and I get the events for the Escape key. Apparently, TelerikToolBar is doing... something.

Is there a way to:
a) make the toolbar less aggressive and let me handle the keydown/keyup events, or
b) detect the Escape and Enter keyclicks from the TelerikTextBox component, to avoid the need for handling the javascript events?

As a curiosity, when focussed on this text box, try pressing Win and then Escape. It produces this sequence of events: "keydown MetaLeft" -> "focusout" -> "focusin" -> "keyup Escape". Yes, you get the Escape event, and the focus returns to the textbox.

Thank you.

Nadezhda Tacheva
Telerik team
 answered on 08 May 2025
1 answer
14 views

I have a TelerikTimePicker component and I have set the ShowClearButton="true". The Value property of the component is bound to a nullable DateTime variable (e.g., DateTime? MyTime). If I first input/select a valid time and then clear the value (using the "x" button in the input field), the component is highlighted in red because the .k-invalid class has been added to the HTML markup. However, the value in the TelerikTimePicker is not actually invalid because a null value is allowed.

This is very similar to this issue for the TelerikDateTimePicker: https://feedback.telerik.com/blazor/1660917-datetimepicker-should-not-get-red-border-when-bound-to-nullable-datetime-and-the-input-is-empty

Dimo
Telerik team
 answered on 08 May 2025
1 answer
14 views

When I click on scheduler appointments where the top isn't visible, the scheduler often (but not always) scrolls up but doesn't scroll up enough to make the top of the appointment visible. I did a video showing what I mean. When you click the bottom part of the longer appointments, the top isn't immediately scrolled to and you have to scroll a little further to make it visible.

Is it possible to configure the scheduler (without custom JS) so that the top of the appointment is visible when clicked?

I haven't fully figured out what triggers it to scroll up either. The shorter appointments don't scroll at all when clicked, even if they are barely visible. The nearest I can tell, any appointment longer than an hour will scroll when clicked but it will only scroll up enough so that the first hour is still hidden. I do see that if the bottom isn't visible, it will always scroll down enough so that the bottom is in view but I'm not sure why the same doesn't happen for the top.

Nadezhda Tacheva
Telerik team
 answered on 08 May 2025
0 answers
10 views

Hi i have a DatePicker in a module form. If i resize the browser window in order to have low visible space below the datepicker, then i open the datepicker popup, it create a strange effect on the page.

For example i have this page with a datepicker (highligted in red):

if i open the datepicker popup the dom change adding white space on bottom of the page:

closing the popup, the white space disappear.

How to solve?

Thanks

 

 

Claudio
Top achievements
Rank 2
Bronze
Bronze
Iron
 asked on 07 May 2025
0 answers
7 views
I'm working with the scheduler and I need the header to be sticky on the page, on scroll. Not just on the grid itself. When I scroll down, I need the header to stick to the top and when I scroll back up, it should go back to its original position. 

The original k-scheduler-header css is already sticky. How do I make it sticky on the page?
Pau
Top achievements
Rank 1
 updated question on 07 May 2025
2 answers
30 views

I have a grid footer and am needing to bind the sum value with a NumericTextBox (TotalDailyDeposit) that is outside the grid.  Both the Grid and NumericTextBox are inside an EditForm.  The sum is being calculated/displayed in the grid successfully on row value update, but the value displayed in TotalDailyDeposit isn't being changed when a new sum is calculated in the grid.  There is also a second NumericTextBox (PriorDailyLimit) outside of the grid.  After changing a value in a grid row I can click in and out of PriorDailyLimit and the TotalDailyDeposit value will update.  This only happens, though, if PriorDailyLimit has an OnChange event handler defined (even if the handler contains no code).  TotalDailyDeposit will also rebind when a Grid row's Edit button is subsequently clicked.  Not updated, just clicked.

It seems like the page-level bind events aren't firing from within the footer because the context is the Grid at that point, but do fire based on other subsequent events that occur at the page level.  Is there any way to cause a rebind of TotalDailyDeposit from within the Grid footer?  

Things I've tried:

  • Binding TotalDailyDeposit to a model property 
  • Binding TotalDailyDeposit to a page variable
  • Using @bind-Value
  • Using Value/ValueExpression

<TelerikNumericTextBox id="PriorDailyLimit" class="form-control form-control-sm" @bind-Value="Model!.PriorDailyLimit" Format="C" Width="150px" Arrows="false" />

...

<FooterTemplate> @{ float? total = (float?)context?.Sum; if (total != null) { Model!.TotalDailyDeposit = (float)total; } else { total = 0f; } } @(((float)total).ToString("C")) </FooterTemplate> ...

 

<TelerikNumericTextBox @bind-Value="Model!.TotalDailyDeposit" class="form-control form-control-sm" Format="C" ReadOnly="true" />


Todd
Top achievements
Rank 1
Iron
 answered on 30 Apr 2025
1 answer
23 views

I'm having trouble with data binding in the drawer component. In order to help isolate + demonstrate the issue I've created a simple test page containing a drawer component with minimal configuration:-

@layout TelerikLayout
@page "/test"

<TelerikDrawer @bind-SelectedItem="SelectedItem"
               Data="Data">
    <DrawerContent><p>Hello</p></DrawerContent>
</TelerikDrawer>

@code {
    private class DrawerItem
    {
        public FontIcon Icon { get; set; }
        public bool Separator { get; set; }
        public string Text { get; set; }
        public string Url { get; set; }
    }

    private List<DrawerItem> Data { get; set; } = new List<DrawerItem> { new DrawerItem { Icon = FontIcon.CaretTr, Text = "Hello" } };

    private DrawerItem? SelectedItem { get; set; }
}

And here is the resulting markup. The drawer component is rendered and so is the drawer content, but no drawer items:-

<div class="k-drawer-container k-drawer-overlay"><!--!-->
<!--!-->
    <div class="k-drawer telerik-blazor k-drawer-start" data-id="2ccfd37c-d109-485f-80e7-654bf55cb5c7" dir="ltr"><!--!-->

        <!--!--><!--!-->

        <div class="k-drawer-wrapper" style="width: 0; transition-duration: 0ms;"><!--!-->
        </div><!--!-->
    </div><!--!-->
    <div class="k-drawer-content"><!--!-->
<!--!--><p>Hello</p>    </div><!--!-->
</div>

I've tried using IEnumerable instead of List, making SelectedItem not nullable, and removing SelectedItem altogether, and the result is the same. I'm on Telerik UI for Blazor version 8.1.1 and all other components appear to be working fine. Any help would be appreciated.

Marco
Top achievements
Rank 3
Iron
Iron
Iron
 updated answer on 30 Apr 2025
0 answers
20 views
I have a grid with first three columns frozen and other columns are horizontally scrollable. Somewhat similar to this example Blazor Grid Columns Frozen (Locked) - Telerik UI for Blazor

Is it possible to display the horizontal scrollbar only for the scrollable columns (and do not display for the frozen columns).

CJ
Top achievements
Rank 2
Iron
 asked on 28 Apr 2025
1 answer
22 views

Hi

Please guide me how can I use Popover in the Map instead of showing Tooltip?

 

Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
 updated answer on 27 Apr 2025
1 answer
19 views

The xlsx.zip contains some strange files, but why is there no normal .xlsx file..

In the past it did produce a normal .xlsx file in the download tool of the spreasheet.

Is there a setting/option for this?

Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
 answered on 27 Apr 2025
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?