Telerik Forums
UI for Blazor Forum
2 answers
372 views

Hello,

is it possible to pre-select the very first row in Grid in SelectionMode="GridSelectionMode.Single"? I need to do that by default when the Grid displays the very first time. I have second grid that based on this selection. I have already implemented the proper way of populating the second Grid and now just need to display display the first row selected.

Thanks.

Andrey
Top achievements
Rank 1
Veteran
 answered on 18 Apr 2020
4 answers
1.9K+ views

The ComboBox control does not appear to be refreshing/updating when the underlying list that it is bound to is updated. Some sample code to replicate this is:

 

@page "/"
@using Telerik.Blazor;

<TelerikComboBox Data="@ComboValues" Value="@SelectedValue"  ValueChanged="@((string v) => ComboBoxSelectionChanged(v))" >
</TelerikComboBox>

@code {
    List<string> ComboValues = new List<string> { "One", "Two", "Three", "Four", "Five" };

    string SelectedValue = null;

    void ComboBoxSelectionChanged(string v)
    {
        ComboValues.Remove(v);
        ComboValues.Add("New " + v);

       SelectedValue = null;
    }
}

Keep in mind this is overly simplistic but does demonstrate what isn't working as expected.

I would expect in this case for the selected entry to be removed from the ComboBox and replaced with "New {Selected Entry}";

I had this working fine relatively recently but started updating my code after upgrading to version 2.10.  Now i can't tell for sure if this is a bug introduced in version 2.10 or if i just made a change that broke things.

Any feedback would be greatly appreciated.

Thank You

Josh 

Joshua
Top achievements
Rank 1
 answered on 16 Apr 2020
3 answers
352 views

The html in bold is generated by the Menu control for a menu item, the non-bold code is from my menu item template.

The k-link / k-menu-link styles provides the mouse over and cursor effect.


<li class="k-item k-menu-item telerik-blazor"
data-id="e5bda03c-693b-4a70-9310-75977f58d39a" role="menuitem"
aria-live="polite" tabindex="0" aria-label="Paste">
    <span class="k-in k-link  k-menu-link   ">
        <span class="lt-menu-item lt-disabled">
            <img src="EditPaste.svg"><span>Paste</span>
        </span>
    </span>
</li>

I'm trying to create a disabled menu item, but I realy need to style the k-menu-link span otherwise the effect is not on the full menu item (see image).

Any thoughts on how to do this, or would it be possible to provide a property that allows a style to be injected into the  <span class="k-in k-link  k-menu-link   ">

Marin Bratanov
Telerik team
 answered on 16 Apr 2020
2 answers
152 views

When a menu is shown I need to be able to enable disable the sub menu items, so I need to hook an expanding event before the sub menu is rendered.

Is there any plan to add an OnExpanding event that is raised before the sub item is expanded?

Marin Bratanov
Telerik team
 answered on 16 Apr 2020
1 answer
211 views
in version 2.10, while not in 2.9 if you refresh F5 a page with a datagrid you get an error: 


System.InvalidOperationException: The current thread is not associated with the Dispatcher. Use InvokeAsync() to switch execution to the Dispatcher when triggering rendering or component state. at Microsoft.AspNetCore.Components.Dispatcher.AssertAccess() at Microsoft.AspNetCore.Components.RenderTree.Renderer.AddToRenderQueue(Int32 componentId, RenderFragment renderFragment) at Microsoft.AspNetCore.Components.ComponentBase.StateHasChanged() at Telerik.Blazor.Components.Common.BaseComponent.StateHasChanged() at Telerik.Blazor.Components.TelerikGridBase`1.RemoveColumn(IGridColumn column) at Telerik.Blazor.Components.TelerikGridBase`1.Telerik.Blazor.Components.Grid.IGridContainer.RemoveColumn(IGridColumn column) at Telerik.Blazor.Components.Grid.GridColumnBase.Dispose() at Microsoft.AspNetCore.Components.Rendering.ComponentState.Dispose() at Microsoft.AspNetCore.Components.RenderTree.Renderer.Dispose(Boolean disposing) --- End of stack trace from previous location where exception was thrown --- at Microsoft.AspNetCore.Components.Rendering.HtmlRenderer.HandleException(Exception exception) at Microsoft.AspNetCore.Components.RenderTree.Renderer.Dispose(Boolean disposing) at Microsoft.AspNetCore.Components.RenderTree.Renderer.Dispose() at Microsoft.AspNetCore.Mvc.ViewFeatures.StaticComponentRenderer.PrerenderComponentAsync(ParameterView parameters, HttpContext httpContext, Type componentType) at Microsoft.AspNetCore.Mvc.ViewFeatures.ComponentRenderer.PrerenderedServerComponentAsync(HttpContext context, ServerComponentInvocationSequence invocationId, Type type, ParameterView parametersCollection) at Microsoft.AspNetCore.Mvc.ViewFeatures.ComponentRenderer.RenderComponentAsync(ViewContext viewContext, Type componentType, RenderMode renderMode, Object parameters) at Microsoft.AspNetCore.Mvc.TagHelpers.ComponentTagHelper.ProcessAsync(TagHelperContext context, TagHelperOutput output) at Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperRunner.<RunAsync>g__Awaited|0_0(Task task, TagHelperExecutionContext executionContext, Int32 i, Int32 count) at JarodProject.Pages.Pages__Host.<ExecuteAsync>b__14_1() in C:\Users\kodie\source\repos\JarodSource\JarodProject\Pages\_Host.cshtml:line 30 at Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperExecutionContext.SetOutputContentAsync() at JarodProject.Pages.Pages__Host.ExecuteAsync() in C:\Users\kodie\source\repos\JarodSource\JarodProject\Pages\_Host.cshtml:line 5 at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderPageCoreAsync(IRazorPage page, ViewContext context) at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderPageAsync(IRazorPage page, ViewContext context, Boolean invokeViewStarts) at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderAsync(ViewContext context) at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.ExecuteAsync(ViewContext viewContext, String contentType, Nullable`1 statusCode) at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.ExecuteAsync(ViewContext viewContext, String contentType, Nullable`1 statusCode) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResultFilterAsync>g__Awaited|29_0[TFilter,TFilterAsync](ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResultExecutedContextSealed context) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.ResultNext[TFilter,TFilterAsync](State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeResultFilters>g__Awaited|27_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|24_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|19_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope) at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger) at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.MigrationsEndPointMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.DatabaseErrorPageMiddleware.Invoke(HttpContext httpContext) at Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.DatabaseErrorPageMiddleware.Invoke(HttpContext httpContext) at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)
Marin Bratanov
Telerik team
 answered on 16 Apr 2020
3 answers
960 views

Hello,

I have two grids on one page. The first one has SelectionMode="GridSelectionMode.Single" and the second one is re-reading the data (SQL) based on this selection. I am using Single Selection and handling the SelectedItemsChanged event. This works fine except the first grid is not unselecting the previously selected row so now it displays all previously selected rows.

Click on first grid first row. First grid first row selected. Grid2 content refreshed. That's fine.

Click on first grid second row. First grid second row selected. Grid2 content refreshed. But the grid1 first row is still selected.

I am using UI Kendo 2.1.

Thanks.

Andrey
Top achievements
Rank 1
Veteran
 answered on 15 Apr 2020
1 answer
696 views

Ideally the Telerik control suite should support some level of drag and drop.

The use cases I'm working through require an explorer folder/file tree to be mamipulated, so being able to drag and drop treenodes around. But I can also see use cases for dragging ListView items and content from other containers.

Blazors built in support for drag and drop is not great, so some kind of basic built in support for this would be really handy.

Marin Bratanov
Telerik team
 answered on 15 Apr 2020
4 answers
676 views

Hi

I have a grid like these

<TelerikGrid Data="@List_GEST_Ordini_Teste_Filtrato" Height="auto"
                 Pageable="true" Sortable="false" Groupable="false" PageSize="20"
                 FilterMode="Telerik.Blazor.GridFilterMode.FilterMenu"
                 Resizable="true" Reorderable="true"
                 SelectionMode="GridSelectionMode.Single"
                 SelectedItemsChanged="@((IEnumerable<ViewListaOrdini> employeeList) => OnSelect(employeeList))">

....

In OnSelect I use the next, to move another page

Navigation.NavigateTo("ordineediting", false);

In 2.9 all works fine, but I've upgraded to 2.10 all stopped to work: OnSelect i called multiple indefinitly

tnx

Marin Bratanov
Telerik team
 answered on 15 Apr 2020
2 answers
454 views

Hi

I've put a TelerikComboBox inside a TelerikWindow not visible by default.

<TelerikComboBox Data="@ListaUnMis"
                                         Filterable="false"
                                         Placeholder="Selezione Unotà di Misura"
                                         @bind-Value="@selectedProduct.CodUnMis" TextField="@nameof(CMD_UnMis.Descrizione)"
                                         ValueField="@nameof(CMD_UnMis.CodUnMis)" AllowCustom="false" >
                        </TelerikComboBox>

In a grid when I click an edit button I open the modal TelerikWindow and set the selectedProduct.

...but .... the inital valu is not displayed. Remain only blank.

Using TelerikDropDownList all works fine.

Tnx

Giampaolo
Top achievements
Rank 1
Veteran
 answered on 14 Apr 2020
1 answer
291 views

Hello,

I have a bool column in my grid displaying checkboxes. This works fine. In the column header I have filer's drop-down box with text "All", "Is true", "Is false".

Is there any way to change this text? I need it be All, Selected, Unselected or something else.

Thanks.

 

Marin Bratanov
Telerik team
 answered on 13 Apr 2020
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?