How to Focus/Select Group header

4 posts, 1 answers
  1. Boo
    Boo avatar
    5 posts
    Member since:
    Jul 2012

    Posted 14 Nov 2012 Link to this post

    How to Focus/Select Group header like focus/select rows
    I used like these

    GridViewGroupRowInfo groupHeader = (GridViewGroupRowInfo)_MyGrid.CurrentRow;
    ....
    ....
    _MyGrid.Groups[groupHeader.Index].GroupRow.IsCurrent  = true;
    _MyGrid.Groups[groupHeader.Index].GroupRow.IsSelected = true;


    But it's does not work.
    How do I do?
    Thank you.
  2. Emanuel Varga
    Emanuel Varga avatar
    1336 posts
    Member since:
    May 2010

    Posted 15 Nov 2012 Link to this post

    Hello,

    Could you please provide some more details on what you are trying to accomplish?

    Screenshots or anything that will help me understand what you are trying to achieve?

    (the same goes for your other post)


    Best Regards,
    Emanuel Varga
    WinForms MVP
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Boo
    Boo avatar
    5 posts
    Member since:
    Jul 2012

    Posted 15 Nov 2012 Link to this post

     Hi Emanuel Varga,

         I have attached an example to select or focus group header on grid.
    In the example after I added row (D 4.2) and I need to focus/select header D4 somethings like that.

    Thank you
    Boo.
  5. Answer
    Emanuel Varga
    Emanuel Varga avatar
    1336 posts
    Member since:
    May 2010

    Posted 15 Nov 2012 Link to this post

    Hello Boo,

    In order to make the Group Header row the current row (selected) it is enough to just set that row as the grid.CurrentRow, like so:
    grid.CurrentRow = grid.Groups[0].GroupRow;

    If you have any other questions, please let me know.

    Best Regards,
    Emanuel Varga
    WinForms MVP
Back to Top