Grid select page 1

1 Answer 48 Views
Grid
Sterling
Top achievements
Rank 2
Iron
Sterling asked on 12 Dec 2022, 08:39 AM

Hi, 

I've got an easy question, but I can't figure it out how it works.

My grid depends on another grid. If I select an item in grid A, grid B should always show page 1. Where and how can I set that page 1 is displayed? I tried it in DataBound, but it leads to a full call stack.

I would appreciate an example.

Thanks

1 Answer, 1 is accepted

Sort by
0
Accepted
Lyuboslav
Telerik team
answered on 13 Dec 2022, 11:15 AM

Hello Sterling,

I would suggest you use the "change" event instead of the "dataBound" event. The"dataBound" triggers when you retrieve the data. On the other hand the "change" triggers when selecting a row in a table.

Below is a code snippet that demonstrates how to achieve the desired result. You should get the reference to the second grid and its dataSource and after that with the "page" method set the needed page:

change:()=>{
          	var gridTwo = $("#gridTwo").data("kendoGrid");
            var gridTwoDataSource = gridTwo.dataSource;
            gridTwoDataSource.page(1);
          },

 

Here you can see the dojo I prepared for you with the above example.

I hope this will help you.

Regards,
Lyuboslav
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/.

Tags
Grid
Asked by
Sterling
Top achievements
Rank 2
Iron
Answers by
Lyuboslav
Telerik team
Share this question
or