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

Set Selected Item and Show It

5 Answers 364 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Gil
Top achievements
Rank 1
Gil asked on 29 Sep 2016, 09:09 AM
It is possible to set the selection in a grid with paging and to show the page with the selection when the grid is initialized.

5 Answers, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 03 Oct 2016, 07:16 AM
Hello Gil,

You can use the select method to achieve this requirement:
http://docs.telerik.com/kendo-ui/api/javascript/ui/grid#methods-select

In addition, I am also sending a sample application to demonstrate a paging-preserving logic for the selected items:
http://docs.telerik.com/kendo-ui/controls/data-management/grid/how-to/Selection/grid-selection-checkbox

Please add the Kendo MVC dll assemblies to the bin folder and run the attached application to see whether it will help you.

Regards,
Eyup
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Gil
Top achievements
Rank 1
answered on 10 Oct 2016, 07:02 AM

Hi Eyup,

thanks for your advice. Unfortunately, I still don't know how to do it. 

I have for instance an item that is on page 10. When the control is initialized,

it should show page 10 and select the item. I wonder, how this can be done,

when the selection seems to be restricted to the items that are currently loaded.

 

Regards

Gil

0
Gil
Top achievements
Rank 1
answered on 10 Oct 2016, 07:08 AM
Hi Eyup,
thanks for your advice. Unfortunately, I still don't know, how to do it.

For instance, I have an item, that is on page 10. When the control is loaded,
it should show page 10 and select that item. I wonder, how this can be done,
when the selection is restricted to the items that are currently loaded.

Regards

Gil
 
0
Eyup
Telerik team
answered on 12 Oct 2016, 06:03 AM
Hi Gil,

The grid is not able to tell on which page is the record is located automatically by its unique record ID. You will need to determine this manually from your database queries and set the default page accordingly:
http://www.telerik.com/forums/setting-initial-grid-page#k6e-hGAqBUWRzMre1eUsyQ
http://www.telerik.com/forums/set-initial-grid-page-so-it-displays-page-other-than-first-page
http://stackoverflow.com/questions/13740339/kendo-ui-grid-mvc-initial-page
http://stackoverflow.com/questions/13976496/how-to-change-kendo-ui-grid-page-index-programmatically


Once the record is among the loaded 10 items, you can now find it and use the select method:
http://docs.telerik.com/kendo-ui/api/javascript/ui/grid#methods-select


Regards,
Eyup
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Gil
Top achievements
Rank 1
answered on 12 Oct 2016, 06:56 AM

Hi Eyup,

thank you for your help. I will give it a try.

Regards

Gil

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