This is a migrated thread and some comments may be shown as answers.

Databinding

1 Answer 33 Views
ScrollView
This is a migrated thread and some comments may be shown as answers.
Peter
Top achievements
Rank 1
Peter asked on 20 Apr 2021, 12:59 PM
Is it possible to bind a scroll view to an Ajax data source?

1 Answer, 1 is accepted

Sort by
0
Mihaela
Telerik team
answered on 23 Apr 2021, 10:41 AM

Hi Peter,

Thank you for your inquiry.

I would suggest configuring the "Read" operation with the Action method, which will return the data in JSON format:

@(Html.Kendo().ScrollView()
  .Name("scrollView")
  .DataSource(d=>
    d.Read(read => read.Action("Read_Data_Method", "ScrollView"))
  )
)

Would you please give a try to this approach and let me know if it works as expected in your case?

 

Best, Mihaela Lukanova Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Peter
Top achievements
Rank 1
commented on 13 May 2021, 08:48 AM

I had to do the following:

@(Html.Kendo().ScrollView()
.Name("scrollView")
.EnablePager(true)
.Navigatable(true)
.ContentHeight("100%")
.TemplateId("scrollview-template")
.DataSource(dataSource => dataSource
.Custom()
.Type("aspnetmvc-ajax")
.Transport(transport => transport
.Read(read => read.Action("GetAnnouncementData", "Home"))
)
.Schema(s => s.Data("Data").Total("Total"))
.ServerPaging(true)
.PageSize(4))
.HtmlAttributes(new { style = "height:320px; width:100%" })
)
Mihaela
Telerik team
commented on 14 May 2021, 01:01 PM

Hi Peter,

Indeed, the provided example is an alternative approach for binding a ScollView to the data via AJAX.

 

Best,
Mihaela Lukanova
Progress Telerik


Tags
ScrollView
Asked by
Peter
Top achievements
Rank 1
Answers by
Mihaela
Telerik team
Share this question
or