BringIndexIntoView with Collapsed Group

3 posts, 1 answers
  1. BobK
    BobK avatar
    7 posts
    Member since:
    Dec 2014

    Posted 19 Feb 2015 Link to this post

    Using RadGridView, I'm attempting to programmatically select a row and bring it into view.  Code works, unless the row is within a collapsed group.  If the row is within a collapsed group, I get an Out Of Range Exception.

    How can I identify and expand the containing groups or otherwise work around this problem?

    Thank you!
    Bob

    Code follows:

    foreach (DataRowView rowView in vm.ResultSet.DefaultView)
    {
         if (rowView["UWI"].ToString().Trim() == uwi)
             {
                 vm.SelectedRowView = rowView;
                 WellsGridView.BringIndexIntoView(WellsGridView.Items.IndexOf(WellsGridView.SelectedItem));
                 break;
             }
    }

  2. Answer
    Vera
    Admin
    Vera avatar
    267 posts

    Posted 20 Feb 2015 Link to this post

    Hi BobK,

    I would suggest you to use RadGridView.ScrollIntoView or RadGridView.ScrollIndexIntoView method instead as BringIndexIntoView will not work before the item containers have been generated. Those methods will also expand the group containing the item.

    Regards,
    Vera
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. BobK
    BobK avatar
    7 posts
    Member since:
    Dec 2014

    Posted 20 Feb 2015 in reply to Vera Link to this post

    Hello, Vera,

    Perfect!  Switching to ScrollIndexIntoView solved the problem nicely.

    Regards,
    Bob
Back to Top