Telerik Forums
UI for Blazor Forum
1 answer
589 views

Hi,

I've migrated my project to version 3.0 and I've issue with row virtualization.

Before migration virtualization was working fine.

  • Version 2.30


<TelerikGrid 

   Data=@_items
   TotalCount=@_browseDataManager.TotalCount 
   OnRead=@ReadItems
   PageSize="10"
   Height="100%"
   RowHeight="40"
   Pageable="false"
   Sortable="true" 
   ScrollMode="GridScrollMode.Virtual">
   <GridColumns>
        <GridColumn Field="@(nameof(UnitOfMeasureDTO.Code))" Title=@_localizer["Form_UnitOfMeasure_Code"] Width="100px" Locked="true" />
        <GridColumn Field="@(nameof(UnitOfMeasureDTO.ShortName))" Width="200px" Title=@_localizer["Form_UnitOfMeasure_ShortName"] Locked="true"/>
              <GridCommandColumn Width="150px" Context="UnitOfMeasureCommands">
              <GridCommandButton OnClick="@((args) => Edit(args.Item as UnitOfMeasureDTO))" Icon="edit"></GridCommandButton>
              <GridCommandButton OnClick="@((args) => Delete(args.Item as UnitOfMeasureDTO))" Icon="delete"></GridCommandButton>
              </GridCommandColumn>
       </GridColumns>
       <GridToolBar>
             <GridCommandButton OnClick="@(() => Create())" Icon="add">@_localizer["Title_Crud_Add"]</GridCommandButton>
       </GridToolBar>
</TelerikGrid>


protected async Task ReadItems(GridReadEventArgs args)
{
      _browseDataManager.CurrentSkip = args.Request.Skip;
      _browseDataManager.CurrentPageSize = args.Request.PageSize;
      await GetDataAsync();
      IsBusy = false;
}

scrolling version 2.30

  • Version 3.0

I've noticed that parameter TotalCount has removed from grid control.


<TelerikGrid 
   Data=@_items 
   OnRead=@ReadItems
   PageSize="10"
   Height="100%"
   RowHeight="40"
   Pageable="false"
   Sortable="true" 
   ScrollMode="GridScrollMode.Virtual">
<GridColumns>
           <GridColumn Field="@(nameof(UnitOfMeasureDTO.Code))" Title=@_localizer["Form_UnitOfMeasure_Code"] Width="100px" Locked="true" />
            <GridColumn Field="@(nameof(UnitOfMeasureDTO.ShortName))" Width="200px" Title=@_localizer["Form_UnitOfMeasure_ShortName"] Locked="true"/>
                               
        <GridCommandColumn Width="150px" Context="UnitOfMeasureCommands">
              <GridCommandButton OnClick="@((args) => Edit(args.Item as UnitOfMeasureDTO))" Icon="edit"/>                                    
             <GridCommandButton OnClick="@((args) => Delete(args.Item as UnitOfMeasureDTO))" Icon="delete"/>                                                            
        </GridColumns>
          <GridToolBar>
                                <GridCommandButton OnClick="@(() => Create())" Icon="add">@_localizer["Title_Crud_Add"]</GridCommandButton>
          </GridToolBar>

</TelerikGrid>

Error


Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]
      Unhandled exception rendering component: Object reference not set to an instance of an object.
System.NullReferenceException: Object reference not set to an instance of an object.
   at Telerik.Blazor.Components.Grid.GridRowCollection`1[[Hyperion365.Web.Shared.DTOs.UnitOfMeasureDTO, Hyperion365.Web.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].BuildRenderTree(RenderTreeBuilder __builder)
   at Microsoft.AspNetCore.Components.ComponentBase.<.ctor>b__6_0(RenderTreeBuilder builder)
   at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment, Exception& renderFragmentException)

Dimo
Telerik team
 updated answer on 02 Feb 2022
1 answer
468 views

The problem happens for "large" files. I re-produced it for files as small as 123,260 bytes (123 kilobytes!) even when FileSelect.MaxFileSize=223260 or MaxFileSize=int.MaxValue!

Is this by design in the FileSelect component to not support files greater than a hundred kilobytes, or am I doing something wrong? There is nothing in the documentation warning about such tiny file limits.

Update:

I can upload files of any size when I add this line to the code. It of course is a hack and the real problem is in the design of FileSelect and should be fixed there.

builder.Services.Configure<HubOptions>(options =>

{
options.MaximumReceiveMessageSize = null;

});

Was this setting enabled by the Telerik engineers who tested the control? Because it is not in the default VS project and anyone creating a vanilla VS project and using FileSelect will not be able to use it with anything > 10-20kb or so :/

Another problem: (sometimes?) even when the file is uploaded successfully using all-default code, the uploaded file cannot be re-written because it remains locked despite the upload process finishing successfully. There is a place in the Telerik code that is opening the destination file and NOT disposing it properly.

Hristian Stefanov
Telerik team
 answered on 01 Feb 2022
2 answers
1.7K+ views

Hi,

 

Where can we find an actual sample/example of how to use this to obtain a file from the stream? Something like

 

file.Stream.GetAllBytes()

 

throws an exception of not being implemented and so far we have not been able to get any other methods to work either.

 

Non of the demos here https://demos.telerik.com/blazor-ui/fileselect/overview seem to actually implement a file upload method, where the stream is used.  The validation demo does not even have server side validation. 

 

Thanks.

Hristian Stefanov
Telerik team
 answered on 01 Feb 2022
0 answers
152 views

I have some dates that are being translated into a different date in my C# from what is in the Component.

I have the below component (I've tried multiple different formats)

<TelerikDatePicker @bind-Value="@this.MyModel.DateOfService" Label="Date of Service" />

When entering the below dates, I get the following outputs.

Entered Date 1 = 11/15/2021

Date 1 Output in C# = 1/15/2021

{1/15/2021 12:11:00 AM} <- Notice the 11 is in the Minutes slot

----------------------

Entered Date 2 = 05/05/1955

Date 2 Output in C# = 1/5/1955

{1/5/1955 12:05:00 AM} <- Notice the 5 is in the Minutes slot

I'm not performing any translation of the dates.

The property is DateTime type and modeled directly to the property, yet it is not interpolating the dates correctly in these cases.

 

Telerik.UI.for.Blazor V 2.27

billy
Top achievements
Rank 2
Iron
Iron
Iron
 asked on 31 Jan 2022
1 answer
1.1K+ views

Hi there, 

I'm new at telerik and I'm trying to use the grid component. 

unfortunately i keep getting this error:

 Unhandled exception rendering component: Could not find 'TelerikBlazor.initGrid' ('TelerikBlazor' was undefined).
      Error: Could not find 'TelerikBlazor.initGrid' ('TelerikBlazor' was undefined).

I have installed telerik.ui.for.blazor in both Client and Server projects. I have installed telerik.ui.for.blazor as i couldn't find anywhere in the documentation the specific packaged that needs to be installed in order to start using the components and I thought the aforementioned should be the right one. 

Please find below code inside the component:

 

<Telerik.Blazor.Components.TelerikGrid Data="@Books">
          <GridColumns>
               <Telerik.Blazor.Components.GridColumn Field="@nameof(Book.Name)"></Telerik.Blazor.Components.GridColumn>
           </GridColumns>
</Telerik.Blazor.Components.TelerikGrid>

 

Please note that using only <TelerikGrid></TelerikGrid> is not permitted by the project. 

Any help would be appreciated. Or if you could please specify which package needs to be installed (in case I have installed the wrong package)

Thank you very much.

 

Kind regards

n/a
Top achievements
Rank 1
Iron
Iron
Iron
 answered on 31 Jan 2022
1 answer
225 views

Hello

 

We have only one filter option in our Grid in a FilterMenu.

The previous css is not working anymore after the update to version 3.0.0.

  .k-filter-menu-container .k-dropdown,
    .k-filter-menu-container .k-state-empty:nth-of-type(2n),
    .k-filter-menu-container .k-textbox:nth-of-type(2n),
    .k-filter-menu-container .k-datepicker:nth-of-type(2n+1),
    .k-filter-menu-container .k-numerictextbox:nth-of-type(2n) {
        display: none;
    }

        .k-filter-menu-container .k-dropdown:first-of-type {
            display: block;
        }

 

We have changed it to:

.k-filter-menu-container .k-dropdownlist,
.k-filter-menu-container .k-state-empty:nth-of-type(2n),
.k-filter-menu-container .k-textbox:nth-of-type(2n),
.k-filter-menu-container .k-datepicker:nth-of-type(2n+1),
.k-filter-menu-container .k-numerictextbox:nth-of-type(2n) {
    display: none;
}

.k-filter-menu-container .k-dropdownlist:first-of-type {
    display: inline-flex;
}

 

But that shows the wrong dropdownlist.

How can we fix that?

 

 

 

 

 

 

 

 

 

Dimo
Telerik team
 answered on 31 Jan 2022
1 answer
216 views

Hi

I have a huge project

I've tried to upgrade to 3.0 but stopped to work

InvalidOperationException: Object of type 'Telerik.Blazor.Components.TreeViewBinding' does not have a property matching the name 'ExpandedItems'

And similare because in textbox label not exist anymore

But: in the documentation I've not read that this property are obsolete

Or other property similar to substite

What is the problem ?? How can I convert the proj to 3.0 ??

Tnx

 

Dimo
Telerik team
 answered on 31 Jan 2022
2 answers
549 views

Hi, 

I use ListView with attached OnRead event handler to page and filter data at database level.

When the filter changed, I only called the read data event handler with the previously saved DataSourceRequest again which assigned the data to the bound list. Now I must use the eventargs properties, which is ok for paging but not for any other data-changing use case.

There is no Grid State like feature in ListView and binding the Data property is forbidden when using OnRead (at least it has no effect).

So, how to manually trigger OnRead in v3.0 ListView?

Hristian Stefanov
Telerik team
 answered on 31 Jan 2022
1 answer
424 views

Hello,

My team would like to create E2E tests in Cypress for the grids we use and we are wondering whether it's possible to set unique ID values on the filter row. Currently, these IDs are just GUID values and we couldn't find a way to modify them.

 

Kind regards,

Greg

Marin Bratanov
Telerik team
 answered on 30 Jan 2022
1 answer
157 views
I am using telerikcombobox inside telerikgridn as column. I need to show a value from db in the empty combobox on pageload. Can anyone please help me. Thank you
Marin Bratanov
Telerik team
 answered on 30 Jan 2022
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?