Unplanned
Last Updated: 18 May 2020 09:03 by ADMIN
Created by: Paul Shearing
Comments: 3
Category: Window
Type: Feature Request
4

Can we please have an [Open] or [Init] or [OnVisible] event exposed for Blazor Windows?

There is a whole bunch of stuff that I need to do in a Window (e.g. custom modal editing form that needs a lot of temporary supporting data structures) and I am having to do the work in a method that that opens the window, before the Window is opened and passing many data structures to the Window as parameters (there could be more than 20 of these). This is messy.

It would be much simpler, neater and efficient to have the Window create these resources on the fly when the Window is made visible and to dispose of them when the window closes. I would then only need to pass a few essential parameters.

I'm guessing this is a new feature request because I cannot see any way of detecting, in the code for a Window, that it has just been opened (or am I missing something?).

Kind regards,

Paul

Completed
Last Updated: 15 Mar 2022 12:10 by ADMIN
Release 3.2.0

Currently, when the window is minimized the content is lost. The content area is detached from the DOM and re-initialized when it is shown again.

<AdminEdit>

Workaround:

You can workaround that issue by creating custom minimize and maximize actions for the window, where you hide the content area with CSS.

Code snippet:

<TelerikWindow Class="@( isMinimized ? "minimize-window" : "maximize-window" )"
               Width="500px"
               Height="@Height"
               Top="40%"
               Left="45%"
               Visible="true">
    <WindowTitle>
        <strong>Status</strong>
    </WindowTitle>
    <WindowActions>
        <WindowAction Name="MyCustomMinimize" OnClick="@CustomMinimize" Icon="@IconName.WindowMinimize"></WindowAction>
        @if (isMinimized)
        {
            <WindowAction Name="MyCustomMaximize" OnClick="@CustomMaximize" Icon="@IconName.Window"></WindowAction>
        }
        <WindowAction Name="Close"></WindowAction>
    </WindowActions>
    <WindowContent>
        <form class="k-form">
            <fieldset class="k-form-fieldset">
                <legend class="k-form-legend">User Details</legend>

                <label class="k-form-field">
                    <span>First Name</span>
                    <input class="k-textbox" placeholder="Your Name" />
                </label>
                <label class="k-form-field">
                    <span>Last Name</span>
                    <input class="k-textbox" placeholder="Your Last Name" />
                </label>
            </fieldset>
        </form>
    </WindowContent>
</TelerikWindow>

@code {
    public bool isMinimized { get; set; }

    public string Height { get; set; } = "350px";

    private void CustomMinimize()
    {
        isMinimized = true;
        Height = "auto";
    }

    private void CustomMaximize()
    {
        isMinimized = false;
        Height = "350px";
    }

}

<style>
    .minimize-window .k-content {
        display: none;
        padding: 0px !important;
    }

    .maximize-window .k-content {
        display: block;
        padding: 16px 16px;
    }
</style>

</AdminEdit>

Unplanned
Last Updated: 20 Sep 2022 13:03 by ZwapSharp
Created by: ZwapSharp
Comments: 0
Category: Window
Type: Feature Request
4
I would like to use an event that fires when the Window is on focus. 
Completed
Last Updated: 09 Sep 2020 09:53 by ADMIN
Release 2.17.0
I am passing an ObservableCollection as a parameter to a component in my WindowContent. If I do that, the window does not open. If I don't pass the parameter, the window opens.
Unplanned
Last Updated: 02 Feb 2021 10:57 by ADMIN
Created by: Oussama
Comments: 0
Category: Window
Type: Feature Request
3

---

admin edit

At the moment this is not guaranteed and if you want to customize the behavior you should use a custom action to get the OnClick handler, and control the window through its parameters.

Here is an example of implementing a custom close button that also fires an event:

 

<TelerikWindow Visible="@IsWindowVisible" Modal="true" Centered="true">
    <WindowTitle>WindowTitle</WindowTitle>
    <WindowContent>
        lorem ipsum
    </WindowContent>
    <WindowActions>
        <WindowAction Name="MyCustomAction" Icon="close" OnClick="@HandleCancel" />
    </WindowActions>
</TelerikWindow>

@code{
    bool IsWindowVisible { get; set; } = true;

    async Task HandleCancel()
    {
        Console.WriteLine("my custom click happened");
        IsWindowVisible = false;//hide the window with your own code if you also want to do that
    }
}

 

---
Unplanned
Last Updated: 24 Sep 2024 13:33 by Alexander
Created by: Alexander
Comments: 3
Category: Window
Type: Feature Request
3
If the last element in the window has tabindex="-1" or the last element is hidden using "display: none", the focus is no longer trapped inside the window and can go to elements outside of it.
Completed
Last Updated: 08 Jan 2021 13:03 by ADMIN
Release 2.7.0

I'm working on blazor server side application.
After update Telerik.UI.for.Blazor from 2.1 to 2.5 (before I updated .net core from 3.0 to 3.1) it shows following error:
InvalidOperationException: The current thread is not associated with the Dispatcher. Use InvokeAsync() to switch execution to the Dispatcher when triggering rendering or component state.

I investigated that it's cause by Telerik window.
The error occurs when window is on start page or when the page is refreshed.
Below code for Index.razor which cause the error:

 

@page "/"
 
<TelerikWindow @bind-Visible="@WindowIsVisible">
    <WindowTitle>
        <strong>The Title</strong>
    </WindowTitle>
    <WindowContent>
        This is my window <strong>popup</strong> content.
    </WindowContent>
    <WindowActions>
        <WindowAction Name="Minimize"></WindowAction>
        <WindowAction Name="Maximize"></WindowAction>
        <WindowAction Name="Close"></WindowAction>
    </WindowActions>
</TelerikWindow>
 
<TelerikButton OnClick="@( () => WindowIsVisible = !WindowIsVisible )">Toggle window</TelerikButton>
 
@code {
    bool WindowIsVisible { get; set; } = false;
}

Thanks
Declined
Last Updated: 13 Mar 2020 10:29 by ADMIN
Created by: Ben Hayat
Comments: 1
Category: Window
Type: Feature Request
2

Login Component:

A) Login dialog  - A popup dialog where we can attach a model to the dialog.

B) Login with register button - Where we can provide the register page or register popup to call

C) Login with Forgot password and rest password

D) Login with default

Unplanned
Last Updated: 18 Apr 2020 11:38 by ADMIN
Created by: Uluç
Comments: 1
Category: Window
Type: Feature Request
2
Is it possible to add a button that has text to the window action section?
Completed
Last Updated: 19 Jul 2022 10:34 by ADMIN
Release 3.5.0

When a Window is declared inside the Content of another Window, the child Window is resized twice the dragged size.

Reproduction: https://blazorrepl.telerik.com/wwahOtEt49vtoFbZ39.

Steps to reproduce:

  1. Open the child Window
  2. Resize the child Window

The behavior occurs when the child Window contains a component. However, it is not applicable for all components. For example, placing a TextBox or simple text in the child Window does not seem to cause an issue.

Unplanned
Last Updated: 22 Apr 2024 14:34 by Frank
Created by: Frank
Comments: 0
Category: Window
Type: Bug Report
2

The Window can display as centered, but after the user moves or resizes it, the app is not able to center the Window programmatically.

The only possible workaround is to toggle the Window's Visible parameter:

https://blazorrepl.telerik.com/weaewmFe32oT4rnQ42

<TelerikWindow @bind-Top="@Top" @bind-Left="@Left" Centered="@Centered" @bind-Visible="@Visible">
    <WindowTitle>
        Title
    </WindowTitle>
    <WindowContent>
        Drag or resize the Window and center it afterwards...
    </WindowContent>
</TelerikWindow>

<TelerikButton OnClick="@( () => Visible = !Visible )">Toggle Window</TelerikButton>
<TelerikButton OnClick="@OnCenterClick">Center</TelerikButton>

@code {
    string Top { get; set; }
    string Left { get; set; }
    bool Centered = false;
    bool Visible { get; set; } = true;

    async Task OnCenterClick()
    {
        Visible = false;
        await Task.Delay(1);

        Top = Left = string.Empty;
        Visible = true;
    }
}

Planned
Last Updated: 15 Nov 2024 13:23 by ADMIN
Scheduled for 2024 Q4 (Nov)

Pressing Shift+Tab initially when the Window is opened, moves the focus from the Window back to the Button that opens it.

Steps To Reproduce:

  1. Open REPL repro
  2. Click "Open Modal" Button
  3. Press "Shift+Tab"
Completed
Last Updated: 11 May 2020 09:28 by ADMIN
Release 2.13.0

==============

Counter.razor:

==============

@page "/counter"

<h1>Counter</h1>

<p>Current count: @currentCount</p>

<button class="btn btn-primary" @onclick="IncrementCount">Click me</button>

<button class="btn btn-danger" @onclick="OpenMiniWin">Open a kendo window</button>

<TelerikButton>Say Hello</TelerikButton>

<div>
    <ul>
        <li>All work and no play makes Jack a dull boy</li>
        <li>All work and no play makes Jack a dull boy</li>
        <li>All work and no play makes Jack a dull boy</li>
    </ul>
</div>


<Tree IsSpecialIcons="true"></Tree>

<TelerikWindow Modal="true" Visible="@isVisibleMiniWin">
    <WindowTitle>
        <strong>The Title</strong>
    </WindowTitle>
    <WindowContent>
        I am modal so the page behind me is not available to the user.
    </WindowContent>    
    <WindowActions>
        <WindowAction Name="Minimize" />
        <WindowAction Name="Maximize" />
        <WindowAction Name="Close" />
    </WindowActions>
</TelerikWindow>



@code {
    int currentCount = 0;
    bool isVisibleMiniWin = false;

    void IncrementCount()
    {
        currentCount++;
    }

    void OpenMiniWin()
    {
        isVisibleMiniWin = true;
    }
}

 

==============

Tree.razor:

==============

<TelerikTreeView Data="@FlatData" >
    <TreeViewBindings>
        <TreeViewBinding IdField="Id" ParentIdField="ParentIdValue" ExpandedField="Expanded" TextField="Text" HasChildrenField="HasChildren" IconField="Icon" />
    </TreeViewBindings>
</TelerikTreeView>

@code {
    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 bool Expanded { get; set; }
    }

    [Parameter]
    public bool IsSpecialIcons { get; set; } = false;

    public IEnumerable<TreeItem> FlatData { get; set; }

    protected override void OnInitialized()
    {
        LoadFlatData();
    }

    private void LoadFlatData()
    {
        List<TreeItem> items = new List<TreeItem>();

        items.Add(new TreeItem()
        {
            Id = 1,
            Text = "Project",
            ParentIdValue = null,
            HasChildren = true,
            Icon = "folder",
            Expanded = true
        });

        items.Add(new TreeItem()
        {
            Id = 2,
            Text = "Design",
            ParentIdValue = 1,
            HasChildren = true,
            Icon = "brush",
            Expanded = true
        });
        items.Add(new TreeItem()
        {
            Id = 3,
            Text = "Implementation",
            ParentIdValue = 1,
            HasChildren = true,
            Icon = "folder",
            Expanded = true
        });

        items.Add(new TreeItem()
        {
            Id = 4,
            Text = "site.psd",
            ParentIdValue = 2,
            HasChildren = false,
            Icon = "psd",
            Expanded = true
        });
        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;
    }
}

Completed
Last Updated: 30 Oct 2019 13:44 by ADMIN
Release 2.3.0

I have the following code that simulates a "wizard" type experience to show my issue with the window actions disappearing.  Step 1 just shows text and Step 2 has a modal window that pops up when the button in that step is clicked. If I go to another step and then back to Step 2 -- then when I click the show pop up button : the modal window pops up but the "window actions" disappear. There is then no way to close the window.

I can move the Telerik Window control out of the conditional and it will work but this is a simplified version of my problem since I have these windows inside child components so I cannot easily do that. I thought about hiding the "steps" with css but I believe that will keep more things around in the DOM which I don't want. I added the "@ref" also to see if that would help but it doesn't make a difference.

Example:

@if (Step == 1)

{
    <div>Step 1</div>
}
else if (Step == 2)
{
<div>Step 2</div>
    <input type="button" @onclick="() => { IsPopupVisible = true; }" class="btn btn-primary" value="show pop up" />
    <br />
    <br />

        <TelerikWindow @ref="win1" @bind-Visible="@IsPopupVisible" Height="500px" Modal="true">
            <WindowTitle>
                <strong>Pricing Term - Configure</strong>
            </WindowTitle>
            <WindowContent>
                <div>
                    stuff goes here
                </div>
            </WindowContent>
            <WindowActions>
                <WindowAction Hidden="false" Name="Minimize"></WindowAction>
                <WindowAction Hidden="false" Name="Maximize"></WindowAction>
                <WindowAction Hidden="false" Name="Close"></WindowAction>
            </WindowActions>
        </TelerikWindow>
  
}
else if (Step == 3)
{
    <div>Step 3</div>
}
<div class="row">
    <div class="col-12">
        <div>
            @if (Step > 1)
            {
                <input type="button" @onclick="() => MoveStep(-1)" class="btn btn-primary" value="<< Go Back" />
            }
            @if (Step < 3)
            {
                <input type="button" @onclick="() => MoveStep(1)" class="btn btn-primary" value="Continue >>" />
            }
        </div>
        <div></div>
    </div>
</div>


@code {
    public TelerikWindow win1 { get; set; }
    public bool IsPopupVisible { get; set; }

    public int Step { get; set; } = 1;

    public void MoveStep(int move)
    {

        Step += move;

    }
}

Completed
Last Updated: 03 Feb 2020 11:23 by ADMIN

Whenever i refresh a page with F5 i get the following error:

 

System.ObjectDisposedException: Cannot process pending renders after the renderer has been disposed.
Object name: 'Renderer'.
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.ProcessPendingRender()
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.AddToRenderQueue(Int32 componentId, RenderFragment renderFragment)
   at Microsoft.AspNetCore.Components.ComponentBase.StateHasChanged()
   at Microsoft.AspNetCore.Components.Rendering.RendererSynchronizationContextDispatcher.InvokeAsync(Action workItem)
   at Microsoft.AspNetCore.Components.ComponentBase.InvokeAsync(Action workItem)
   at Telerik.Blazor.Components.TelerikWindow.Refresh()
   at Telerik.Blazor.Components.TelerikWindow.Dispose()
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__139_0(Object state)
   at Microsoft.AspNetCore.Components.Rendering.RendererSynchronizationContext.ExecuteSynchronously(TaskCompletionSource`1 completion, SendOrPostCallback d, Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.AspNetCore.Components.Rendering.RendererSynchronizationContext.ExecuteBackground(WorkItem item)

 

Application is working normally after an error. Am i doing something wrong?

Completed
Last Updated: 12 Oct 2022 07:26 by ADMIN
Release 3.7.0 (09 Nov 2022)
Created by: Jerome
Comments: 1
Category: Window
Type: Bug Report
1

<TelerikWindow Width="80%" Height="auto" Top="404px" State="WindowState.Minimized" Left="200px" Class="myClass" Visible="true" ><WindowTitle>My Title</WindowTitle><WindowActions><WindowAction Name="Minimize"></WindowAction></WindowActions><WindowContent><h1>My Content</h1></WindowContent></TelerikWindow>

 

Window starts out minimized, with proper width, height, top and left.

Clicking maximize button clears the top and left property, and resets position every time you open/close.

  • Click/dragging to move the window will reapply top/left property, and then maximize/minimize works properly.

 

If you change the state to to WindowState.Maximized, it has the correct top/left property, but resets the width/height properties.

Window is not draggable.

 

Not setting the State at all is the only way to have proper behavior.


Completed
Last Updated: 05 Sep 2022 05:02 by ADMIN
Release 3.6.0 (14 Sep 2022) (R3 2022)
Created by: Yaimo
Comments: 0
Category: Window
Type: Bug Report
1

The page scrolls instead of the window component moving.

You can drag it a few pixels at a time at most.

EDIT:

A workaround could be to disable touch events for dragging (which may also help for other components like the Splitter):

<TelerikWindow Visible="true" Class="workaround-for-touch-drag">
    <WindowTitle>the title</WindowTitle>
    <WindowContent>the content</WindowContent>
</TelerikWindow>

<style>
    .workaround-for-touch-drag {
        touch-action: none;
    }
</style>

Completed
Last Updated: 23 Jun 2022 12:40 by ADMIN
Release 3.5.0
I'm unable to use the drag bars on the Gantt timeline tasks at V3.3.0. When I move the drag handles on the timeline bar the whole window moves rather than extending the bar. I rolled back to V3.1.0 using the same code and the drag bars worked as they should.
Unplanned
Last Updated: 21 Dec 2022 11:54 by Venu
The dropdown is not showing all items and the page behind the window is scrolling instead.
Completed
Last Updated: 27 Feb 2023 12:43 by ADMIN
Release 4.1.0 (15/03/2023)

Seems to be a bug in the 4.0.1 release that causing a resizing event to fire as a window is closed - this means that you have to close the window twice.

This appears when the text exceeds the width of the pop up causing it to wrap. In the attached example, the yellow highlighted text is too long for the window. Shorter texts that don't wrap don't seem to cause the issue.

This bug is repeatable in your demo code:

@page "/"

<h1>Hello, world!</h1>

Welcome to your new app.<br />

<TelerikButton OnClick="@SayHelloHandler" ThemeColor="@(ThemeConstants.Button.ThemeColor.Primary)">Say Hello</TelerikButton>

<br />

@helloString

<TelerikButton OnClick="@ButtonClicked" Title="Open Window">Open Window</TelerikButton>

<TelerikWindow @bind-Visible="@IsLearnMoreWindowVisible"
               MaxHeight="90%"
               MaxWidth="90%"
               Modal="true"
               Centered="true">
    <WindowTitle>
        <strong>Learn More: Something</strong>
    </WindowTitle>
    <WindowContent>
        @(new MarkupString("<p>What is the form called? Will appear in the Header to show the user what they are looking at. Any spaces in the name will be stripped during code generation for T-SQL.</p>"))
    </WindowContent>
    <WindowActions>
        <WindowAction Name="Close" OnClick="@(() => IsLearnMoreWindowVisible = false)"></WindowAction>
    </WindowActions>
</TelerikWindow>

@code {
    MarkupString helloString;
    bool IsLearnMoreWindowVisible = false;

    void SayHelloHandler()
    {
        string msg = string.Format("Hello from <strong>Telerik Blazor</strong> at {0}.<br /> Now you can use C# to write front-end!", DateTime.Now);
        helloString = new MarkupString(msg);
    }

    void ButtonClicked()
    {
        IsLearnMoreWindowVisible = true;
    }
}