Duplicated
Last Updated: 02 Mar 2020 13:24 by ADMIN
Created by: Shaun
Comments: 1
Category: Grid
Type: Bug Report
0

Here is how this page looks on mac, multiple browsers: https://demos.telerik.com/blazor-ui/grid/grouping

 

 

Notice that the columns are misaligned.  I believe this is because the scrollbar isn't rendered on a mac if it is "disabled" (there is nothing to scroll). 

Probably the best solution would be for it to render like this on all browsers, but have the columns line up (get rid of the spacer in the end of the header row) as the 'empty' scrollbar is not attractive :)

Duplicated
Last Updated: 02 Mar 2020 13:27 by ADMIN

Hello,

I'm trying the grid component and I'm able to add a row to the grid using the embbed editor. But I wanted to add an item externally to the list:


<button @onclick="@MyClick">Add item</button>

 

void MyClick()
{
    MyData.Add(new SampleData() { ID = 46, Name = "from click" });
    StateHasChanged();
}

The new line does not appear on the grid but if I add a second item through the embbed editor then I get the 2 items!

I also try to replace the List<MyData> by an ObservableCollection<MyData> unsuccessfully.

 

Thanks & regards,

 

Duplicated
Last Updated: 02 Mar 2020 13:22 by ADMIN
Created by: Shaun
Comments: 2
Category: Grid
Type: Bug Report
1

Consider the following scenario:

<TelerikGrid Data="Animals" Sortable="true">
  <TelerikGridColumns>
    <TelerikGridColumn Field="Color"></TelerikGridColumn>
    <TelerikGridColumn Field="Breed"></TelerikGridColumn>
  </TelerikGridColumns>
</TelerikGrid>

@functions {
  public List<Animal> Animals { get; set; } = new List<Animal> { new Dog { Breed = "Sheepdog", Color = "Black" } };

  public class Animal { public string Color { get; set; } }
  public class Dog : Animal { public string Breed { get; set; } }
}

Everything renders fine for the grid until you attempt to sort by Breed, which results in the following exception:

System.ArgumentException: Invalid property or field - 'Breed' for type: Animal
   at Telerik.DataSource.Expressions.MemberAccessTokenExtensions.CreateMemberAccessExpression(IMemberAccessToken token, Expression instance)

 

Not sure what is going on under the hood here, but perhaps this could be fixed by looking at the type of the object, rather than the underlying list?    I'm aware that this can be fixed by changing the data source to List<Dog> , but I think this use case of using a base-class is useful for many dynamic scenarios (think dynamic columns, etc)

1 2