How to expand the last group in the grid ?

3 posts, 1 answers
  1. Marc Roussel
    Marc Roussel avatar
    429 posts
    Member since:
    Dec 2009

    Posted 19 Jul 2010 Link to this post

    If I want to select the last line with this :

    if (_Jobs.Count > 0)
    {
        rgvJobs.SelectedItem = _Jobs[_Jobs.Count - 1];
        rgvJobs.ScrollIntoView(_Jobs[_Jobs.Count - 1]);
    }

    It doesn't when the grid is groupped
    so I guess I have to expand the last group before using the code above ?
  2. Answer
    Milan
    Admin
    Milan avatar
    1989 posts

    Posted 20 Jul 2010 Link to this post

    Hello Marc Roussel,

    You just have to replace ScrollIntoView with ScrollIntoViewAsync and groups will be expanded automatically. For example:

    if (_Jobs.Count > 0) 
        rgvJobs.SelectedItem = _Jobs[_Jobs.Count - 1]; 
        rgvJobs.ScrollIntoViewAsync(_Jobs[_Jobs.Count - 1], null); 
    }


    Kind regards,
    Milan
    the Telerik team
    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 Public Issue Tracking system and vote to affect the priority of the items
  3. DevCraft banner
  4. Marc Roussel
    Marc Roussel avatar
    429 posts
    Member since:
    Dec 2009

    Posted 20 Jul 2010 Link to this post

    Great.  Thank you
Back to Top