Telerik Forums
UI for Blazor Forum
2 answers
184 views

    How to do this with the Telerik button?

Thanks … Ed

 

Randy Hompesch
Top achievements
Rank 1
 answered on 27 Nov 2019
3 answers
417 views

once a grid is declared in markup, and for columns that are sortable, reorderable and resizable. I want to persist that settting from grid UI and later apply those settings back to grid, in @code section (some event handler handles save column setting, apply column settings)?

this requires @code block to be able to access the grid object and the columns inside it. it is possible? 

Wei
Top achievements
Rank 1
 answered on 26 Nov 2019
1 answer
4.8K+ views

There are times where my blazor application looses connection over the web sockets, generally sue to inactivity.

 

Example: a user might open a telerik window, enter some values in some text boxes, come back later and want to submit what they entered but unless they refresh the page no buttons work on the page.

 

I am going to give them a save status option to save current work if they have to leave for a bit but is there a setting I should be enabling somewhere to help with connection timeouts?

Marin Bratanov
Telerik team
 answered on 25 Nov 2019
2 answers
113 views

Hi,

Are there plans to incorporate frozen/locked columns?

Thanks … Ed

 

Randy Hompesch
Top achievements
Rank 1
 answered on 25 Nov 2019
5 answers
2.5K+ views

I would like to be able to use the Telerik window component within my forms... for example, a field where you select a person from a database - but finding that person is a complicated search - so instead of a dropdown, it's a display only field that has an ellipsis button next to it, and it would open a window, where they would find a person, select the person, and then pass back the selection to the main form. 

But the telerik blazor window doesn't seem to render within the scope of the form that you nest it under, so the containing EditContext is not available, and I have tried everything I can think of to get the data back from the window and update the main form data behind the scenes, but the EditContext still doesn't know about the change.

Example Below (3 files)

FormTest.razor:

@page "/formtest/"
 
@using SMS5.BApp.Classes
 
<CascadingValue Value="@MyStuff">
    <div class="sms-tab-content">
 
        <EditForm EditContext="@StuffForm" @key="@("FormEditCtx1")">
            <div>MAIN FORM:</div>
            <div>
                SomeStuff1: <InputText @bind-Value="@MyStuff.SomeStuff1"></InputText>
                SomeStuff2: <InputText @bind-Value="@MyStuff.SomeStuff2"></InputText>
            </div>
 
            <div>Component Containing Window:</div>
            <WindowTest2 OnChanged="@StuffGotUpdated"></WindowTest2>
 
        </EditForm>
        <div>
            <div>Log of changes to form context:</div>
            <textarea @bind="@Log" cols="150" rows="20"></textarea>
        </div>
    </div>
</CascadingValue>
                                
 
@code {
 
 
    protected EditContext StuffForm { get; set; }
    public Stuff MyStuff = new Stuff() { SomeStuff1="foo", SomeStuff2="bar"};
    public string Log { get; set; }
 
    protected override void OnInitialized()
    {
        StuffForm = new EditContext(MyStuff);
        StuffForm.OnFieldChanged += EditContext_OnFieldChanged;
    }
 
    private void EditContext_OnFieldChanged(object sender, FieldChangedEventArgs e)
    {
        // code to save goes here
        var x = e.FieldIdentifier.FieldName;
        Log += "--" + x +" changed.--";
        StateHasChanged();
    }
 
    protected void StuffGotUpdated()
    {
        StateHasChanged();
    }
 
}

WindowTest2.razor:

@using SMS5.BApp.Classes
 
<div>
    <div>
        <TelerikButton OnClick="@OpenWin">
            Open Window
        </TelerikButton>
    </div>
    <div>
        <div>In window component, outside of window, from cascading parameter:</div>
        Some Stuff 1:<InputText @bind-Value="@MyStuff.SomeStuff1"></InputText>
        Some Stuff 2:<InputText @bind-Value="@MyStuff.SomeStuff2"></InputText>
    </div>
</div>
 
 
<TelerikWindow Top="50px" Left="100px" Visible="@IsVisible">
    <WindowTitle>
        <strong>The Title</strong>
    </WindowTitle>
    <WindowActions>
        <WindowAction Name="Minimize" />
        <WindowAction Name="Maximize" />
        <WindowAction Name="Close" />
    </WindowActions>
    <WindowContent>
        <div>
            <input @bind-value="@SomeStuff1Local" /> (local var copied to and back from SomeStuff1)
        </div>
        <div>
            <input @bind-value="@MyStuff.SomeStuff2" /> (direct bind to MyStuff.SomeStuff2)
        </div>       
        <TelerikButton OnClick="@CloseWin">
            Close Window
        </TelerikButton>
    </WindowContent>
</TelerikWindow>
 
 
<TelerikButton OnClick="@InvokeCallback">
    Refresh All
</TelerikButton>
 
 
@code {
 
    [CascadingParameter] public Stuff MyStuff { get; set; }
 
    [Parameter] public EventCallback<string> OnChanged { get; set; }
 
    public bool IsVisible { get; set; } = false;
 
    public string SomeStuff1Local { get; set; }
 
    protected void OpenWin()
    {
        IsVisible = true;
        SomeStuff1Local = MyStuff.SomeStuff1;
        StateHasChanged();
    }
 
    protected void CloseWin()
    {
        IsVisible = false;
        MyStuff.SomeStuff1 = SomeStuff1Local;
        StateHasChanged();
    }
 
    protected void InvokeCallback()
    {
        OnChanged.InvokeAsync("blah");
    }
 
    protected override void OnInitialized()
    {
 
    }
 
}

 

Stuff.cs:

namespace SMS5.BApp.Classes
{
  public class Stuff
  {
     public string SomeStuff1 { get; set; }
     public string SomeStuff2 { get; set; }
  }
}

 

p.s. I am still working of a reproducible example for the grid inline editing with EF proxy issue, it is going to take a little while to get that together.

Thanks

Portia

Marin Bratanov
Telerik team
 answered on 25 Nov 2019
4 answers
633 views

Hi,

I guess this is a feature request! It would be good if I could set the bind-value to a property of the same type as the type of the IEnumerable used to populate the list.

At the moment I'm not sure if this is possible as it seems to insist on a Value Field, but I don't want to bind to a field I want to bind to the whole class. So instead of this:

<TelerikDropDownList Data="@NavSets" TItem="UiNavSet" TValue="Guid" Width="200px"
  TextField="DisplayName"
  ValueField="Id"
  @bind-Value="@CurrentNavSetId" PopupHeight="100" />
 
@{
        [Parameter]
        public List<UiNavSet> NavSets { get; set; }
 
        private Guid _currentNavSetId;
        Guid CurrentNavSetId
        {
            get => _currentNavSetId;
            set
            {
                if (_currentNavSetId != value)
                {
                    _currentNavSetId = value;
                    ChangeNavSet(_currentNavSetId);
                }
            }
        }
 
}

I want to do this:

 

<TelerikDropDownList Data="@NavSets" TItem="UiNavSet" TValue="UiNavSet" Width="200px"
  TextField="DisplayName"
  ValueField="?????"
  @bind-Value="@CurrentNavSet" PopupHeight="100" />
 
@{
        [Parameter]
        public List<UiNavSet> NavSets { get; set; }
        public UiNavSet CurrentNavSet { get; set; }    // Bind to this
}

 

I'm not sure if this achievable, or what to put in ValueField??

Thanks.

Marin Bratanov
Telerik team
 answered on 22 Nov 2019
1 answer
3.6K+ views

I think I found a bug in all components that use AnimationGroupBase.
How you can reproduce it...

Navigate to a page that has a component that uses AnimationGroupBase - in my case TreeView.

Hit refresh (F5) a couple of times

Wait about 60 seconds and you will get an exception from the title..

The problem is AnimationGroupBase. It has a async void Dispose method. Please fix it to be just void.

Here is a stack trace.

Microsoft.AspNetCore.Components.Server.Circuits.CircuitHost: Error: Unhandled exception in circuit 'uU2u6m_DXs2TW1iUNDEpwJB235BzcJVRHTXjF8kbbaU'.

System.Threading.Tasks.TaskCanceledException: A task was canceled.
   at Microsoft.JSInterop.JSRuntime.InvokeWithDefaultCancellation[T](String identifier, Object[] args)
   at Telerik.Blazor.Components.AnimationContainer.AnimationGroupBase.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 Microsoft.AspNetCore.Components.Rendering.RendererSynchronizationContext.<>c.<.cctor>b__23_0(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 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at Microsoft.AspNetCore.Components.Rendering.RendererSynchronizationContext.ExecuteBackground(WorkItem item)

Marin Bratanov
Telerik team
 answered on 21 Nov 2019
1 answer
154 views

Hi,

I have just updated to v2.3 but I dont see version 2.4 in my NuGet package manager. I have check "Include prerelease" but I get "No packages found". I have updated all my Microsoft.AspNetCore.* packages to 3.1.0.-preview3.19555.2

Marin Bratanov
Telerik team
 answered on 20 Nov 2019
2 answers
472 views

Upgraded to the latest and am getting these errors.

 

Project builds and so far seems to function regardless.

 

 

SeverityCodeDescriptionProjectFileLineSuppression State
ErrorCS0234The type or namespace name 'Shared' does not exist in the namespace 'PurchaseRequest' (are you missing an assembly reference?)PurchaseRequestC:\Users\rjd\source\repos\PurchaseRequest\PurchaseRequest\Pages\Index.razor1Active
ErrorCS0246The type or namespace name 'MainLayout' could not be found (are you missing a using directive or an assembly reference?)PurchaseRequestC:\Users\rjd\source\repos\PurchaseRequest\PurchaseRequest\Pages\Index.razor1Active
ErrorCS0234The type or namespace name 'Shared' does not exist in the namespace 'PurchaseRequest' (are you missing an assembly reference?)PurchaseRequestC:\Users\rjd\source\repos\PurchaseRequest\PurchaseRequest\Pages\Index.razor1Active

Rick
Top achievements
Rank 1
Veteran
 answered on 19 Nov 2019
1 answer
931 views

I'm trying to change the content of a GridCommandButton based upon a value from the current row - 

I was thinking it would be something like this:

<GridCommandButton Command="Custom" Icon="edit" OnClick="@DisableIntegrator">

<Template>
@{
var integrator = context as Integrator;
integrator.IsActive ? "Deactivate" : "Activate";
}
</Template>



</GridCommandButton>

Marin Bratanov
Telerik team
 answered on 18 Nov 2019
Narrow your results
Selected tags
Tags
+? more
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Andrey
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Andrey
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?