Telerik Forums
UI for Blazor Forum
1 answer
8 views

Hi, I was looking for a way to specify that a grid column should toggle thru the ListSortDirection in a different order. By default it appears a sortable column toggles through its sort directions in this order:

1st click to sort - Ascending

2nd click - Descending

3rd click - no sort

That works for a majority of our grids and their columns (primarily strings and numbers) but we have some columns like 'Last Modified' dates that I'd like it to:

1st click to sort - Descending

2nd click - Ascending

3rd click - no sort

This would also be more intuitive with our grids that we set their initial sort column to a date column in Descending order on page load. The 'first sort' a user expects is Descending on those columns.

I assume there's a way to use OnStateChanged to do this but it'd involve tracking state changes ourselves and other custom code to try to indicate a certain column should toggle sort directions through different orders. Way too much work for us to introduce into our product at this time. Other tech stacks provide a way to specify the toggle order via column properties, and was hoping such a feature either existed or could be added. Thanks!

Hristian Stefanov
Telerik team
 answered on 20 May 2022
2 answers
98 views
Is there a way to select the entire row automatically when a user presses key up or key down? 
Eric
Top achievements
Rank 1
Iron
Iron
 updated answer on 20 May 2022
6 answers
161 views

I like the ability to select a row by clicking on a checkbox. But the handler for clicking on the row supplies the contents of the row where as putting a GridCheckbox like

<GridColumns>
    <GridCheckboxColumn ValueChanged="@((bool value) => ValueChanged(value))"/>

 

only gives me the state of the checkbox. Is there anyway to have the row click handler also respond to the checkbox? Or how can I get the contents of the row that the checkbox that was clicked is on?

Tobias
Top achievements
Rank 1
Iron
 answered on 19 May 2022
1 answer
5 views

Hi,

 

Is it possible to get event when user click/double click task on Gantt chart (grid/timeline). We should update some properties based on selected task.

 

Is it possible to create new dialog for popup editing?

 

 

 

Hristian Stefanov
Telerik team
 answered on 19 May 2022
1 answer
5 views

I am trying to use the Telerik.Blazor.Components.TelerikNumericTextBox.  

Upon opening the form in question, I receive the following in the output window:

   [2022-05-18T14:08:20.156Z] Error: System.AggregateException: One or more errors occurred. (Format specifier was invalid.)
    ---> System.FormatException: Format specifier was invalid.
      at System.Number.NumberToString(ValueStringBuilder& sb, NumberBuffer& number, Char format, Int32 nMaxDigits, NumberFormatInfo info)
      at System.Number.FormatDecimal(Decimal value, ReadOnlySpan`1 format, NumberFormatInfo info)
      at System.Decimal.ToString(String format, IFormatProvider provider)
      at Telerik.Blazor.Common.Parsers.TelerikGenericDecimal`1.Format(T value, String format)
      at Telerik.Blazor.Components.TelerikNumericTextBox`1.get_FormattedValue()
      at Telerik.Blazor.Components.TelerikNumericTextBox`1.get_Text()
      at Telerik.Blazor.Components.TelerikNumericTextBox`1.GetNumericTextBoxOptions()
      at Telerik.Blazor.Components.TelerikNumericTextBox`1.OnAfterRenderAsync(Boolean firstRender)

 

The razor markup for the control is:

                <TelerikNumericTextBox  Width=@ControlWidth.ToString() 
                                        @bind-Value="@NumericValue"
                                        Decimals="2" 
                                        Format="D" 
                                        Id=@FieldProperties.Field_Name
                                        OnChange="@TextOnChangeHandler"/>

 

Right now the control is bound to a Decimal Property  (public decimal NumericValue)

and the initial value is hardcoded to 1200.26M

 

Any assistance would be appreciated.

Ray
Top achievements
Rank 1
Iron
 answered on 18 May 2022
1 answer
7 views
It would be greatly beneficial to our projects if there were enhancements to the Filter component to allow for supplying custom Filter Operators. For example, our legacy software provided native "Between" operator support along with custom "Date Range" operators, such as "today", "Yesterday", "This Week", etc. While I wouldn't expect Telerik to support these out of the box, it would be great to be able to add our own operators/Filter types.
Tsvetomir
Telerik team
 answered on 18 May 2022
7 answers
286 views

Hello -

I've been really enjoying my time with the Telerik Blazor Grid component, but I'm running into trouble with the filtering functionality.  This is using a Blazor Web Assembly Client with a ASP.NET Core 3 backend.  When my client requests data from the API without a filter, I get appropriate responses as expected.  Paging works great, everything is good.  As soon as I try any off-the-shelf filter, I get an error response from the server with the message :

Could not create an instance of type Telerik.DataSource.IFilterDescriptor. Type is an interface or abstract class and cannot be instantiated.

It looks like this is some sort of deserialization error that is being run into when the server is trying to parse my DataSourceRequest.  It gets parsed fine without a filter, but as soon as I try to filter, I get the above message.

Has anyone else seen and tackled this problem?  Thanks much!

- Chris

 

Jordy
Top achievements
Rank 1
Iron
 answered on 18 May 2022
4 answers
183 views

I don't see any loading indicator when going between pages of a grid with remote data... are there plans for this?

web
Top achievements
Rank 2
Veteran
Iron
 answered on 17 May 2022
0 answers
5 views
i have one button when i click that button it will excecute storedprocedure and generate excel file in Asp.net core Blazor Application
Pranay
Top achievements
Rank 1
 asked on 17 May 2022
1 answer
5 views

I am using a TreeView control that displays checkboxes for each node and the checked state of each node seems to get lost when the parent node is collapsed and expanded again.  However, this only seems to happen when the OnExpand event is handled. Remove the OnExpand event handler and everything works as expected. It doesn't seem to make a difference if the event args property ShouldRender is set to true. Happens for both flat and hierarchical data.

Can't imagine that this is the desired behaviour. If it is then is there any way around it as I do need to handle the OnExpand event in my code behind.

The following is test page the displays this problem...

@page "/treeview"
@using System.Linq

<TelerikTreeView Data="@Data" CheckBoxMode="@TreeViewCheckBoxMode.Multiple" CheckChildren="true" CheckParents="true"
                 @bind-CheckedItems="@CheckedItems" OnExpand="@OnExpandHandler">
                 @*@bind-ExpandedItems="@ExpandedItems"*@
    <TreeViewBindings>
        <TreeViewBinding IdField="Id" TextField="Text" HasChildrenField="HasChildren" ItemsField="Children">
            <ItemTemplate>
                @{ 
                    var item = context as MyTreeItem;
                    <div>@item.Id.ToString() : @item.Text</div>
                }
            </ItemTemplate>
        </TreeViewBinding>
    </TreeViewBindings>
</TelerikTreeView>

@code {
    private IEnumerable<MyTreeItem> Data { get; set; }
    private IEnumerable<object> CheckedItems { get; set; } = Enumerable.Empty<object>();
    private IEnumerable<object> ExpandedItems { get; set; } = Enumerable.Empty<object>();
    private int LastID = 0;

    protected override void OnInitialized()
    {
        Data = CreateNodeList("one", "two", "three", 3);
    }

    private List<MyTreeItem> CreateNodeList(string name1, string name2, string name3, int levels = 0)
    {
        var list = new List<MyTreeItem>();
        list.Add(CreateNode(name1, levels));
        list.Add(CreateNode(name2, levels));
        list.Add(CreateNode(name3, levels));
        return list;
    }

    private MyTreeItem CreateNode(string name, int levels)
    {
        LastID++;
        var node = new MyTreeItem { Id = LastID, Text = name };
        if (levels > 0)
        {
            node.Children = CreateNodeList($"{name} - one", $"{name} - two", $"{name} - three", levels - 1);
        }
        return node;
    }

    private async Task OnExpandHandler(TreeViewExpandEventArgs args)
    {
        //await InvokeAsync(StateHasChanged);
        //args.ShouldRender = true;
    }

    private class MyTreeItem 
    {
        public int Id { get; set; } = 0;
        public string Text { get; set; } = "";
        public IList<MyTreeItem> Children { get; set; } = null;
        public bool HasChildren => Children is not null && Children.Count > 0;
    }
}

Tsvetomir
Telerik team
 answered on 17 May 2022
Top users last month
tar
Top achievements
Rank 2
Iron
Matthias
Top achievements
Rank 5
Bronze
Bronze
Iron
Shane
Top achievements
Rank 2
Iron
Iron
Daniel
Top achievements
Rank 3
Iron
Iron
Iron
SSirica
Top achievements
Rank 2
Iron
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?