Group by date

2 Answers 34 Views
Grid TreeList
Peter
Top achievements
Rank 1
Veteran
Iron
Peter asked on 07 Jun 2021, 01:45 PM

Hi,

I have some measurement date in a database table:

...
        public int Number { get; set; }
        public DateTime Start { get; set; }
        public long ElapsedTime { get; set; }
...

I want make a view similar in the attached image with expandable rows group by the date.

In the Viewmodel I add a property to get the Date from Start to support GROUP BY Date:

public IQueryable<MeasurementViewModel> GetMeasurements()
        {
            var result = _context.Measurement.Select(w => new MeasurementViewModel
            {
                Date = w.Start.Date,
                Start = w.Start,
                Number = w.Number,
                ElapsedTime = w.ElapsedTime,
            }); ;
            return result;
        }

What is better to use: Grid with Grouping and aggregat or TreeList?

For TreeList I dont have parentID and childID. I think it is possible to calculate it.

The standard Grid group example doesn't work: if I drag the Date column to the header only the waiting spinner is shown.

A solution for the grid should be: without Text "Drag a column header..." and not changeable by user.

The expandable date-header-rows sould show some aggregates per day: Count()  and SUM(ElapsedTime).

Is that possible?

Best regards,

Peter

 

2 Answers, 1 is accepted

Sort by
0
Accepted
Dimo
Telerik team
answered on 10 Jun 2021, 09:55 AM

Hello Peter,

The described scenario is more suitable for a Grid, rather than a TreeList. This is because the TreeList is designed for hierarchical data and the "group" parents are actual items in the data. In your case, the data is not truly hierarchical and parents do not exist - they are only used to combine items with matching dates.

Everything mentioned is possible to implement:

Regards,
Dimo
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

0
Peter
Top achievements
Rank 1
Veteran
Iron
answered on 11 Jun 2021, 04:08 PM

Hello Dimo,

thank you. I try the grouping feature of the grid with hidden top panel .

Exists a documentation, which k- classes are used in the Blazor components? The source code would be useful, which is available for Telerik® UI for ASP.NET Core, WinForms but not for Blazor.

Regards,

Peter

 

Dimo
Telerik team
commented on 14 Jun 2021, 02:51 PM

Hey, Peter.

We plan to provide the UI for Blazor source code in November 2021.

I am afraid we don't have extensive documentation for the k-classes. So far the potential benefit does not seem to outweigh the amount of required effort, so we prefer to invest in other documentation tasks. Usually, a developer will need to customize a specific element, so inspecting it in the browser's dev toolbar will reveal the CSS class to work with.

On the other hand, we have a comprehensive list with the variables used to compile the themes: https://github.com/telerik/kendo-themes/blob/develop/docs/customization/variables-overview.md

Tags
Grid TreeList
Asked by
Peter
Top achievements
Rank 1
Veteran
Iron
Answers by
Dimo
Telerik team
Peter
Top achievements
Rank 1
Veteran
Iron
Share this question
or