How to cycle through all datarows in a Grid in the order that is currently selected in the grid

10 posts, 0 answers
  1. hkdave95
    hkdave95 avatar
    245 posts
    Member since:
    Nov 2006

    Posted 14 Apr 2008 Link to this post

    Hi

    I am trying to find out upon which page a particular data row falls.

    In order to do this I need to cycle through each row in the grid in the current order of the grid.

    Please can you tell me how I might retreive a collection showing all items in the Grid in it's current order.

    Kind Regards

    David
  2. Iana Tsolova
    Admin
    Iana Tsolova avatar
    3388 posts

    Posted 17 Apr 2008 Link to this post

    Hello hkdave95,

    Could you give us more details on how is the row order changed? Is it because of server or client event? What happens when the data row falls? Any additional information can lead us to the source and we would be able to find a proper solution for you.

    Best wishes,
    Iana
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. hkdave95
    hkdave95 avatar
    245 posts
    Member since:
    Nov 2006

    Posted 17 Apr 2008 Link to this post

    Hi

    I am referring to an order change if any of the sort buttons are pressed.

    This will change the page that the item falls upon therefore when I attempt to locate it and "open" the row in say edit mode I need the "current order" within the grid.

    Hope this provides enough information.

    Kind Regards

    David
  5. Iana Tsolova
    Admin
    Iana Tsolova avatar
    3388 posts

    Posted 18 Apr 2008 Link to this post

    Hi hkdave95,

    Thank you for the details.
    You could retrieve the current order of the grid's items on ItemDataBound. This event is fired after the NeedDataSource, therefore after the grid has received the new sorted data. And here you could see the order in which the items are bound and find where your data row falls.

    Let us know if you need further directions.

    Sincerely yours,
    Iana
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  6. hkdave95
    hkdave95 avatar
    245 posts
    Member since:
    Nov 2006

    Posted 18 Apr 2008 Link to this post

    Hi

    I am actually trying to find the page that a row falls on in the ItemCommand Event.

    In order to do this I need to "for each" the current collection of data in the current sort order.

    Any more ideas ?

    Kind Regards

    David
  7. Iana Tsolova
    Admin
    Iana Tsolova avatar
    3388 posts

    Posted 21 Apr 2008 Link to this post

    Hello hkdave95,

    Unfortunately on ItemCommand the new order is not available yet. When the grid is sorted, the ItemCommand event is fired where the new sort expressions are added to the grid. Then the NeedDataSource event is fired and the sorted data is passed to the grid. After that on ItemDataBound the items are bound with the new order and you could retrieve it here. The new order of the grid items is available on PreRender event. 

    Find more information about the grid event sequence here.

    Please let us know if you need more help and if I missed something in my explanation.

    Best regards,
    Iana
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  8. hkdave95
    hkdave95 avatar
    245 posts
    Member since:
    Nov 2006

    Posted 22 Apr 2008 Link to this post

    Hi

    Correct me if I am wrong but the ItemDataBound event does not cyle through all data items.

    I thought that it cycles through the current page items. Therefore how am I going to hit the item if it lies on another page ?

    Correct me if I am wrong.

    Kind Regards

    David
  9. Iana Tsolova
    Admin
    Iana Tsolova avatar
    3388 posts

    Posted 22 Apr 2008 Link to this post

    Hello hkdave95,

    You are right that only the items of the current page are available on ItemDataBound. And unfortunately only data items of the current page are accessible and available through the grid lifecycle. Therefore on ItemDataBound, DatBound or PreRender events of the grid you could check if your data row falls on the current page and then implement the corresponding logic for it.

    I hope this information helps.

    Greetings,
    Iana
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  10. hkdave95
    hkdave95 avatar
    245 posts
    Member since:
    Nov 2006

    Posted 23 Apr 2008 Link to this post

    Hi

    Are you planning a method which might allow a user to cycle through the items in a grid in current sort order ? Outside of ItemDataBound that is.

    Kind Regards

    David
  11. Iana Tsolova
    Admin
    Iana Tsolova avatar
    3388 posts

    Posted 24 Apr 2008 Link to this post

    Hello hkdave95,

    I am afraid that we do not have plans to implement methods traversing through data items which are not from the current page.

    Please excuse us for the inconvenience.

    Greetings,
    Iana
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017