Unplanned
Last Updated: 21 May 2024 14:15 by ADMIN
Created by: MichaƂ
Comments: 3
Category: UI for Blazor
Type: Bug Report
14

When filtering or editing a Grid with enum data, the Name property of their Display parameter is respected.

However, in the initial view mode of the Grid the Name property is not applied and the enum values are rendered regardless of whether or not their Display parameter has a Name property defined.

 

==========

ADMIN EDIT

==========

In the meantime, a workaround you might try is to create a custom method to check whether Display attribute is defined and get and display its Name property, otherwise display the Enum's member name.

You can then use a Template for the column that uses enum data, cast its context to the model you are using and invoke the method on the field containing the enum. The sample below demonstrates how you can achieve this.

@using System.ComponentModel.DataAnnotations
@using System.Reflection

<TelerikGrid Data=@MyData EditMode="@GridEditMode.Inline" Pageable="true" Height="500px"
             OnUpdate="@UpdateHandler" FilterMode="@GridFilterMode.FilterRow">
    <GridColumns>
        <GridColumn Field=@nameof(SampleData.ID) Editable="false" Title="ID" />
        <GridColumn Field=@nameof(SampleData.Name) Title="Name" />
        <GridColumn Field=@nameof(SampleData.Role) Title="Position">       
            <Template>
                @{
                    var currentEmployee = context as SampleData;
                    var currentRole = GetDisplayName(currentEmployee.Role);                        
                }

                @currentRole
            </Template>
        </GridColumn>
        <GridCommandColumn>
            <GridCommandButton Command="Save" Icon="save" ShowInEdit="true">Update</GridCommandButton>
            <GridCommandButton Command="Edit" Icon="edit">Edit</GridCommandButton>
        </GridCommandColumn>
    </GridColumns>
</TelerikGrid>

@code {
    //custom method to check whether Display attribute is defined and get and display its Name property, otherwise display the Enum's member name
    public string GetDisplayName(Enum val)
    {
        return val.GetType()
                  .GetMember(val.ToString())
                  .FirstOrDefault()
                  ?.GetCustomAttribute<DisplayAttribute>(false)
                  ?.Name
                  ?? val.ToString();
    }


    public void UpdateHandler(GridCommandEventArgs args)
    {
        SampleData item = (SampleData)args.Item;

        //update the view-model
        var index = MyData.FindIndex(i => i.ID == item.ID);
        if (index != -1)
        {
            MyData[index] = item;
        }

        //perform actual data source operations here
    }

    //model and dummy data generation
    public class SampleData
    {
        public int ID { get; set; }
        public string Name { get; set; }
        public Role Role { get; set; }
    }

    public enum Role
    {
        [Display(Name = "Manager")]
        ManagerRole,
        [Display(Name = "Employee")]
        EmployeeRole,
        [Display(Name = "Contractor")]
        ContractorRole
    }

    public List<SampleData> MyData { get; set; }

    protected override void OnInitialized()
    {
        MyData = new List<SampleData>();

        for (int i = 0; i < 50; i++)
        {
            MyData.Add(new SampleData()
            {
                ID = i,
                Name = "name " + i,
                Role = (Role)(i % 3) // just some sample to populate initial values for the enum
            });
        }
    }
}

Unplanned
Last Updated: 09 Nov 2022 09:13 by Hest
I am using the new .NET 7 feature to Render Razor components from JavaScript. When I try to render a Telerik UI for Blazor component a JavaScript exception is thrown. 
Unplanned
Last Updated: 05 Sep 2022 08:15 by ADMIN
Created by: Fredrich Irian
Comments: 4
Category: UI for Blazor
Type: Bug Report
6

If you are in edit mode using InCell, clicking somewhere else inside or outside the Grid should fire OnUpdate if the item is valid. However, if you click on some customly added element in the Grid (e.g. button, icon, dropdown) this will not fire OnUpdate for a valid item.

In Incell edit, clicking anywhere besides the edited cell should fire OnUpdate for a valid input.

 

 

---

ADMIN EDIT

---

A possible workaround for the time being - in the OnClick handler of the custom element get the edited item from the Grid State. Update the item and programmatically close the edit mode.

For example: https://blazorrepl.telerik.com/ccuMGovv08NIX6u544.

 

 

Unplanned
Last Updated: 27 Jan 2023 09:18 by ADMIN
Created by: Buddhi
Comments: 1
Category: UI for Blazor
Type: Bug Report
5
I am using Telerik blazor grid and it is groupable and can be edited cell itself. i have used a button to group the grid.but after grouping when i am going to edit a cell ,entire grid is getting loaded.
following you can see a my code sample .how we can edit cell without loading grid .


@using System.ComponentModel.DataAnnotations 

<TelerikButton ThemeColor="primary" OnClick="@SetGridGroup">Group</TelerikButton>


<TelerikGrid Data=@MyData EditMode="@GridEditMode.Incell" Pageable="true" Height="500px"
            OnUpdate="@UpdateHandler" 
            OnEdit="@EditHandler" 
            OnDelete="@DeleteHandler"
            OnCreate="@CreateHandler" 
            OnCancel="@OnCancelHandler"
            Groupable="true">
    <GridToolBarTemplate>
        <GridCommandButton Command="Add" Icon="@FontIcon.Plus">Add Employee</GridCommandButton>
    </GridToolBarTemplate>
    <GridColumns>
        <GridColumn Field=@nameof(SampleData.ID) Title="ID" Editable="false" />
        <GridColumn Field=@nameof(SampleData.FirstName) Title="Name" />
        <GridColumn Field=@nameof(SampleData.LastName) Title="Last Name" />

        <GridColumn Field=@nameof(SampleData.Team ) Title="Team" />
        <GridCommandColumn>
            <GridCommandButton Command="Delete" Icon="@FontIcon.Trash">Delete</GridCommandButton>
        </GridCommandColumn>
    </GridColumns>
</TelerikGrid>
@code {
    async Task SetGridGroup()
    {
        GridState<SampleData> desiredState = new GridState<SampleData>()
        {
            GroupDescriptors = new List<GroupDescriptor>()
            {
                new GroupDescriptor()
                {
                    Member = "Team",
                    MemberType = typeof(string)
                },
                
            },
            // choose indexes of groups to be collapsed (they are all expanded by default)
            CollapsedGroups = new List<int>() { 0 },
        };
        await Grid.SetStateAsync(desiredState);
    }
    void EditHandler(GridCommandEventArgs args)
    {
        SampleData item = (SampleData)args.Item;
        // prevent opening for edit based on conditionif (item.ID < 3)
        {
            args.IsCancelled = true;// the general approach for cancelling an event
        }
        Console.WriteLine("Edit event is fired.");
    }
    async Task UpdateHandler(GridCommandEventArgs args)
    {
        SampleData item = (SampleData)args.Item;
        await MyService.Update(item);
        await GetGridData();
        Console.WriteLine("Update event is fired.");
    }
    async Task DeleteHandler(GridCommandEventArgs args)
    {
        SampleData item = (SampleData)args.Item;
        await MyService.Delete(item);
        await GetGridData();
        Console.WriteLine("Delete event is fired.");
    }
    async Task CreateHandler(GridCommandEventArgs args)
    {
        SampleData item = (SampleData)args.Item;
        await MyService.Create(item);
        await GetGridData();
        Console.WriteLine("Create event is fired.");
    }
    void OnCancelHandler(GridCommandEventArgs args)
    {
        SampleData item = (SampleData)args.Item;
        Console.WriteLine("Cancel event is fired. Can be useful when people decide to not satisfy validation");
    }
    public class SampleData
    {
        publicint ID { get; set; }
        [Required]
        public string FirstName { get; set; }
        public string LastName { get; set; }

        public string Team {get;set;}
    }
    public List<SampleData> MyData { get; set; }
    async Task GetGridData()
    {
        MyData = await MyService.Read();
    }
    protected override async Task OnInitializedAsync()
    {
        await GetGridData();
    }
   publicstaticclassMyService
    {
        private static List<SampleData> _data { get; set; } = new List<SampleData>();
        public static async Task Create(SampleData itemToInsert)
        {
            itemToInsert.ID = _data.Count + 1;
            _data.Insert(0, itemToInsert);
        }
        publicstaticasync Task<List<SampleData>> Read()
        {
            if (_data.Count < 1)
            {
                for (int i = 1; i < 50; i++)
                {
                    _data.Add(new SampleData()
                    {
                        ID = i,
                        FirstName = "Name " + i.ToString(),
                        LastName = "Last Name " + i.ToString(),

                        Team="Team" +(i%5).ToString()
                    });
                }
            }
            returnawait Task.FromResult(_data);
        }
        public static async Task Update(SampleData itemToUpdate)
        {
            var index = _data.FindIndex(i => i.ID == itemToUpdate.ID);
            if (index != -1)
            {
                _data[index] = itemToUpdate;
            }
        }
        public static async Task Delete(SampleData itemToDelete)
        {
            _data.Remove(itemToDelete);
        }
    }
}


Unplanned
Last Updated: 04 Sep 2023 10:49 by ADMIN
Created by: Christa
Comments: 5
Category: UI for Blazor
Type: Bug Report
4

When downloading files via the TelerikPdfViewer bytes are added before and after the PDF Dokument.

Browsers are able to show the documents but you get and error message if you try to open the downloaded document in Acrobar Reader or in a DMS.

The document attached was download from the demo on your web site.

Unplanned
Last Updated: 12 Jun 2024 06:20 by ADMIN
Created by: Jesper
Comments: 4
Category: UI for Blazor
Type: Bug Report
4
I am using MS Playwright to create End2End tests. It worked fine when we used MudBlazor, but after we migrated to telerik I have run into a problem with the TelerikDropDownList.

It stops working if you open it too fast. It goes into a state where no matter what you do (Rebind/changing data bound values etc.), it will not open and show items.

It can be reproduced easily by calling .Open() in OnInitializedAsync()

I have reproduced it without MS Playwright in REPL, so you can easily debug it.

https://blazorrepl.telerik.com/QIOUYoPc57iQKy6702

If you uncomment the await Task.Delay(3000); the code will work.

Expected behavior:
It is ok that Open() does nothing while the control is initializing. It is not ok that just because you called Open() once, then you are forever stuck without being able to open it later, no matter how long you wait or what you do with the items.

I do not want to insert random Delays in my code either as I expect the TelerikDropDownList to not malfunction just because I open it too early.

I hope you can prioritize this as right now the DropDownList is not usable for us.
Unplanned
Last Updated: 27 Jun 2022 16:38 by ADMIN

Further to issue reported in https://feedback.telerik.com/blazor/1545177-selected-items-are-not-preserved-when-loading-the-state-when-the-component-is-bound-to-expandoobjects wrt Expando Object, the column menu reset also does not work when grid is bound to Expando Object

 

Regards

Naved

Unplanned
Last Updated: 21 Jun 2023 10:16 by ADMIN
When I open the dropdown of any select component (DropDownList, AutoComplete, ComboBox, MultiColumnComboBox, MultiSelect) that has Virtualization enabled and try to scroll with the up/down error keys past the page size I get an exception. 
Unplanned
Last Updated: 15 Jan 2024 10:01 by ADMIN
Created by: ManojKumar
Comments: 4
Category: UI for Blazor
Type: Bug Report
3

When I place a tooltip on drawer item, it just flickers randomly

[video-to-gif output image]

https://blazorrepl.telerik.com/wQbbmbGb05hzznPh45

 
Unplanned
Last Updated: 10 Jun 2024 21:22 by ADMIN
Created by: Justin
Comments: 4
Category: UI for Blazor
Type: Bug Report
3

When SelectOnFocus="true" is enabled on the NumericTextBox control, and a format (e.g., Format="N1") is set, the SelectOnFocus functionality does not select all text if the decimal value has no trailing digits. For instance, with the value 76, the text is not selected on focus, but with the value 76.1, the text is selected correctly.


<TelerikNumericTextBox @bind-Value="@DecimalValue" Format="N1" SelectOnFocus="true"/>

@code {
    private decimal DecimalValue = 76;
}

 

Steps to Reproduce:

  1. Add a NumericTextBox control to a Blazor Server application.
  2. Set SelectOnFocus="true".
  3. Set a format, e.g., Format="N1".
  4. Enter a value such as 76 (with no trailing digits after the decimal point).
  5. Focus on the NumericTextBox.

Expected Behavior: The entire text (in this case, 76.0) should be selected when the NumericTextBox gains focus.

Actual Behavior: The text is not selected when the NumericTextBox gains focus if the value has no trailing digits after the decimal point (e.g., 76). However, if the value includes trailing digits (e.g., 76.1), the text is selected as expected.

Unplanned
Last Updated: 12 Apr 2023 09:00 by ADMIN

TelerikDateInput control works fine in windows (browsers chrome and edge) and android (chrome)

on iPhone (safari) the page jumps to top every time after user provides a value for day, month or year.

code:

<TelerikDateInput Id="dobId"
  @bind-Value="@_applicationViewModel.DateOfBirth"
  Format="dd/MM/yyyy">
<DateTimePickerFormatPlaceholder Day="dd" Month="mm" Year="yyyy" />
</TelerikDateInput>

 

see video attached

Unplanned
Last Updated: 17 Sep 2021 13:24 by ADMIN

We're using a Blazor grid with OData filtering on the server. To construct the url we're using ToODataString on the DataSourceRequest of the grid.

This is working fine as long as we don't add a '&' symbol to the filter. It seems that the ToODataString doesn't replace the & symbol to %26

Here is the reult of our ToODataString, note the red bold &.

$count=true&$filter=(Updated%20ge%202021-08-16T00:00:00.0000000Z%20and%20Updated%20le%202021-09-16T23:59:59.0000000Z%20and%20(contains(Barcode,%27&<-this%20should%20be%20escaped%27)))&$orderby=Cart%20desc&$skip=0&$top=50

Unplanned
Last Updated: 11 Jan 2023 20:46 by Sean

I am handling the SelecteditemsChanged event of the Grid and when an exception is thrown in its handler, the ErrorBoundarydoes not catch it.

For reference, I tried attaching the same handler to a click of a button and it is successfully caught by the ErrorBoundary in this case.

Unplanned
Last Updated: 26 Apr 2023 13:23 by ADMIN

If the Height parameter is not specified, in the Gantt tree list, every line after the number of lines of the initial display are not shown.

 

The steps are easy to reproduce:

Start from the official Gantt Demo in the REPL and simply remove the Height parameter from TelerikGantt.

If you do this, you will see that opening the children of the first and only element in the tree list will show everything correctly in the Timeline part (if no mistake) but doesn't show the children lines in the TreeList part.

 

Therefore, I believe, the Height parameter should become mandatory until we can allow the height of the Gantt to be dynamic without rendering issues.
Unplanned
Last Updated: 06 May 2024 05:46 by ADMIN

I've determined that the TelerikDateTimePicker does not work properly on mobile devices when using AdaptiveMode.Auto. Attached are videos of the component's behaviour in both modes (None, and Auto).

Immediately after interacting with the fullscreen popup of the datepicker, I see this error in the console:

RAW:
telerik-blazor.js:50 Uncaught TypeError: r.isParent is not a function

    at p.isChild (telerik-blazor.js:50:1362352)
    at f.closePopup (telerik-blazor.js:50:1398427)
    at HTMLHtmlElement.onMouseDown (telerik-blazor.js:50:1397246)

Code:

@using Telerik.Blazor.Components
@using Telerik.Blazor

<TelerikFloatingLabel Text="Date & Time">
    <TelerikDateTimePicker Id="date-picker" @bind-Value="MyFormModel.Date" Max="@DateTime.Now.AddDays(1)"
                           Format="@DATE_FORMAT" AdaptiveMode="AdaptiveMode.Auto"
                           FillMode="@Telerik.Blazor.ThemeConstants.DateTimePicker.FillMode.Flat" />
</TelerikFloatingLabel>
@code {
    private FormModel MyFormModel { get; set; } = new FormModel();
    private const string DATE_FORMAT = "MM/dd/yyyy HH:mm";

    private class FormModel
    {
        public DateTime Date { get; set; }
    }
}

Notes:
- If we remove all of the parent components wrapping the DatePicker, it seems to function properly, but the errors remain in the console. This isn't a solution, however.

Unplanned
Last Updated: 15 May 2024 08:33 by Ben
The IsEntityFrameworkProvider method in the DataSource package returns false when the provider is Entity Framework Core. 
Unplanned
Last Updated: 26 Jan 2023 12:57 by ADMIN

When edit is initiated from code with virtual scroll, a duplicate OnRead request is also triggered.

But this is not the case when built-in edit command button is used.

Demo