Scroll bar doesn't always appear on grid with endless scroll

1 Answer 82 Views
Grid
Logan
Top achievements
Rank 1
Veteran
Logan asked on 08 Jun 2022, 02:20 PM

I have a number of grids that use the Endless scroll with the scrollable height set to 500 (see helper code below) with a default page size of 10.  Sometimes the vertical scollbar doesn't appear on the grid even though it indicates that there are more records then are being shown (pages).  

If i set the height to something else, for instance 472 it seems to show the scroll bar, but i am worried this is driven by the size of the rows and won't be durable.

 


        public static GridBuilder<T> EndlessScrollDefault<T>(this GridBuilder<T> gridBuilder, string emptyMsg = "There are no records to show.", int? height = 500) where T : class
        {
            var rVal = gridBuilder.Pageable(page =>
            {
                page.Enabled(true);
                page.PageSizes(false);
                page.Input(false);
                page.Numeric(false);
                page.PreviousNext(false);
                page.Refresh(true);
                page.Messages(message => message.Empty(emptyMsg));
            })
                .Scrollable(s => s.Endless(true));
            if (height != null)
            {
                rVal = rVal.Scrollable(s => s.Height(height.Value));
            }
            return rVal;
        }

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 13 Jun 2022, 12:10 PM

Hi Logan,

 

Thank you for writing to us.

I can see that there is some GridBuilder class in your project. Is this a custom Class definition?

We generally encourage our users to avoid inheriting or extending the Kendo/MVC/Core widgets and components:
https://docs.telerik.com/kendo-ui/intro/widget-basics/create-custom-kendo-widget#note-on-technical-support

The components were not designed with this kind of capability in mind and this kind of custom enhancement can prove fragile and unreliable.

Therefore, what I suggest in this case is that you share with us the bigger picture - what you want to achieve at its entirety so we can better grasp the scenario and provide helpful suggestions, which do not include extending or inheriting.

Instead of a custom HtmlHelper, you can choose one of the following:

1. Partial .cshtml page with the Grid + all the required configuration. Then, you can simply call and render this partial page in your original main pages.

2. Generic javascript logic to access all Kendo Grids on the page and apply your custom settings.

3. Custom shared Editor Templates depending on the scenario.

I hope this would work for your case.

 

Regards,
Eyup
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.

Tags
Grid
Asked by
Logan
Top achievements
Rank 1
Veteran
Answers by
Eyup
Telerik team
Share this question
or