Telerik Forums
UI for Blazor Forum
1 answer
249 views

I have a main grid that can have 300+ rows.

Within that each row can be expanded to a sub grid with say 100 rows.

And then each row within that has 4 sub grids that can have 20-30 rows.

I have it built and working but on large accounts this runs way too slow!

Each grid has its own class and there are loops filling in each grid.

I am looking for a faster way to load those grids.

I am wonder if I could be pointed in the direction of an example that shows say how to load each sub grid on the fly when its parent grid is expanded.

Thanks in advance.

Deasun

Deasun
Top achievements
Rank 3
Bronze
Bronze
Bronze
 answered on 09 May 2023
0 answers
129 views

Hello, 

I have the following grid:

<TelerikGrid Data="@Customers"
                 Pageable="false"
                 Sortable="true"
                 ScrollMode="@GridScrollMode.Virtual"
                 OnRead="@ReadItems"
                 LoadGroupsOnDemand="true"
                 FilterMode="@GridFilterMode.FilterRow"
                 PageSize="20">
        <GridColumns>
            <GridColumn Field="Number" Title="Nr" Width="150px" />
            <GridColumn Field="Zip" Title="ZIP"></GridColumn>
            <GridColumn Field="City" Title="City"></GridColumn>
            <GridColumn Field="FirstName" Title="First"></GridColumn>
            <GridColumn Field="LastName" Title="Last"></GridColumn>
        </GridColumns>
    </TelerikGrid>

with code-behind:

public async Task<DataEnvelope<CustomerDTO>> FetchPagedData(DataSourceRequest dataSourceRequest)
{
        var result = await Http.PostAsJsonAsync(ApiRoutes.Customer.POST_Lazy(), dataSourceRequest);
        var fullList = await result.Content.ReadFromJsonAsync<DataEnvelope<CRMCustomerDTO>>();
        return fullList;
 }

protected async Task ReadItems(GridReadEventArgs args)
{
        var dataResult = await FetchPagedData(args.Request);

        if (args.Request.Groups.Count > 0)
        {
            args.Data = dataResult.GroupedData.Cast<object>().ToList();
        }
        else
        {
            args.Data = dataResult.CurrentPageData.Cast<object>().ToList();
        }

        args.Total = dataResult.TotalItemCount;

        StateHasChanged();
}

and web-api:

[HttpPost("Lazy")]
public async Task<DataEnvelope<CustomerDTO>> GetLazy([FromBody] DataSourceRequest dataSourceRequest)
{
            DataEnvelope<CustomerDTO> dataEnvelope = new();

            var customers = await _context.Customer
                                            .Include(c => c.Address)
                                            .ToListAsync();

            var customerDTOs = _mapper.Map<List<CustomerDTO>>(customers);


            DataSourceResult result = customerDTOs.ToDataSourceResult(dataSourceRequest);

            if (dataSourceRequest.Groups.Count > 0)
            {
                dataEnvelope = new DataEnvelope<CustomerDTO>
                {
                    GroupedData = result.Data.Cast<AggregateFunctionsGroup>().ToList(),
                    TotalItemCount = result.Total
                };
            }
            else
            {
                dataEnvelope = new DataEnvelope<CustomerDTO>{
                    CurrentPageData = result.Data.Cast<CustomerDTO>().ToList(),
                    TotalItemCount = result.Total
                };
            }

            return dataEnvelope;
}

Now, when im calling the method FetchPagedData() the filters are set correctly.
However, in GetLazy() the filters are not. The correct amount of filters is set, but every set filter is empty with the operator IsEqualTo.

Why is that and how can I fix it?
I tried building my own object with the filters and recreate it from there, but I can't access the members of IFilterDescriptor.

 

Any help is much appreciated!

Colin
Top achievements
Rank 1
 asked on 08 May 2023
1 answer
861 views

Hi all, 

I want to edit the text "Drag a column header and drop it here to group by that column" to another text with a specific column's name. Please help me!!!

Thank you,

Dimo
Telerik team
 answered on 06 May 2023
1 answer
622 views

Hi,

Filtering and editing grid columns of the type datetimeoffset doesn't currently seem to be supported.

 

Is there anyway to work around this?

Currently the datetimepicker supports datetimeoffset so for consistency it should be supported in the gird aswell, is this something that will be fixed in future releases?

Nadezhda Tacheva
Telerik team
 answered on 05 May 2023
1 answer
160 views

By default the Breadcrumb appears to fade the last item (page you're currently on) as seen on the screenshot attached. Is there anyway to remove this affect, I would like it instead to have the text bolded to represent the current breadcrumb. Is this possible to remove and if so, how?

 

Radko
Telerik team
 answered on 04 May 2023
1 answer
190 views

On the appointment edit dialog I would like to validate the Title field(see screenshot below) without having to do it in the OnCreateHandler or OnUpdateHandler.  I have tried validation in these events, but it closes the dialog and I have to re-enter the data once again.  I would like to not have to enter the data over again in case a title gets duplicated inadvertently. 

So my question is: is there a way to assign validation to the input fields?

 

Nadezhda Tacheva
Telerik team
 answered on 02 May 2023
1 answer
401 views

Hello,

both in the docs and demos, the text says (emphasis mine) "the ParentId field which points to the Id of the item that will contain the current item", yet the model shows the field as "public int? Parent { get; set; }" without the Id at the end? Seems like one or the other is wrong? Also I don't see any mention if the Id fields have to be specifically int, or if they could be string for.ex.?

Edit.: It actually seems that you can set the name of the ParentId Property, and that is done in the examples I linked. Still a bit confusing for people like me who don't read the whole thing.

Secondly, would be nice if I didn't have to "pollute" my models with the "HasChildren" property. The TreeView is obviously looking at some things in the data (for.ex. it's looking for the one item with null as Parent and if the HasChildren is true, it's looking for them) so would be great if it would look through the data and see if there are children for a given item automatically. Now it feels I have to tell it twice, first with the Id/ParentID properties and secondly with HasChildren.

Thirdly, currently the TreeView exposes the items that have been checked as the bindable CheckedItems collection. For this I think it would be easier if we could configure something like "my model has the boolean property ThisItemIsCheckedNow, use that as the checked indicator" and then, when checking items, that given property on the model would be true or false as the UI checkbox is checked/unchecked.

Dimo
Telerik team
 answered on 02 May 2023
1 answer
430 views

I would like to retrieve the width of the gris columns (to save it) and programmatically set it when needed.

I tried using gridref.GridColumns but I don't know how to retrieve gridcolumn object.

 

Dimo
Telerik team
 answered on 02 May 2023
2 answers
795 views

Hello,

How do I force user input to uppercase?

I have this mask:  Mask="00-LLLA00000000"

I want the LLL to always be uppercase.

When A is an alpha character, I want it to be uppercase as well.

Thanks,

TFISHER

Brett
Top achievements
Rank 1
Iron
 updated answer on 02 May 2023
0 answers
328 views

I am interested in replacing the predefined dialog function (Alert, Confirm, Prompt) with custom dialogs. I have the Alert working, but not sure how to setup a custom version of ConfirmAsync. I know I need to do an await in my custom routine, but how do I setup the async logic flow? Is an async version of the VisibleChanges event required? Is there are example you can point me to?

 

Thanks,

Bryan

 

 
Bryan
Top achievements
Rank 1
 asked on 28 Apr 2023
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?