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

How to get the items in the visible order?

3 Answers 25 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Thomas
Top achievements
Rank 1
Thomas asked on 07 Dec 2018, 08:59 AM

Hello,

is there a way to get the list of visible rows of a grid in the order, as they appear on the screen (respect sorting, filtering, pinning)?

Best regards,
Thomas

3 Answers, 1 is accepted

Sort by
0
Dinko
Telerik team
answered on 12 Dec 2018, 08:01 AM
Hello Thomas,

You could try using the Items collection property of the RadGridView. This collection contains that currently shown items in the grid.

Regards,
Dinko
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Thomas
Top achievements
Rank 1
answered on 12 Dec 2018, 08:21 AM

Hello Dinko,

thanks for your reply. Unfortunately Items does not respect pinned rows. When a row is pinned by the user and appears as first item (or last, depending on PinnedRowsPosition), the position of the pinned row does not change in Items.

Best regards,
Thomas

0
Dinko
Telerik team
answered on 14 Dec 2018, 12:52 PM
Hi Thomas,

What you could try to get the current visible pinned rows is to bind the IsPinned property of the GridViewRow. You can create Implicit Style to bind the IsPinned property to custom one from your business objects. Then you can loop the Items collection for items which have this property set to true. 

I have a feeling that you want to get the current position of the pinned rows. I have searched for a possible solution and I think I manage to found one. What you can do is to add GridViewPinRowColumn. Inside this column, there is a GridViewPinButton. You can subscribe to its Click event using AddHandler() method and create a custom collection which will hold the pinned rows and the orders which they're a pinned. I have created a sample project which demonstrates this approach. You just need to implement the logic inside the Click event handler.

Regards,
Dinko
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
GridView
Asked by
Thomas
Top achievements
Rank 1
Answers by
Dinko
Telerik team
Thomas
Top achievements
Rank 1
Share this question
or