Row 0 is always selected

2 posts, 0 answers
  1. Eric Klein
    Eric Klein avatar
    183 posts
    Member since:
    Aug 2009

    Posted 30 Jul 2012 Link to this post

    DISREGUARD:  I found the error and it was in another method that for some reason was coded to alwyas select the last row.

    When ever my form is loaded with a radgirdview control on it the row 0 is always selected.  The grid is a multiselect and It is set so the user can select multiple rows and then click a button and all rows that are selected will be updated.

    On the form load I have this code
    POSSGridView.CurrentRow = null;

    and I loop through the rows as follows
    foreach (GridViewRowInfo rowInfo in POSSGridView.Rows)
                   if (rowInfo.IsSelected)

    The issue is when the form loads if I hit the button the .SelectedRows has row 0 in it.  If I select it and then select another row and hit the button not eh .SelectedRows has both rows as being selected even though on the screen the 0 row is not selected.  I am unalbe to find anyway to not have the 0 row selected.
  2. Emanuel Varga
    Emanuel Varga avatar
    1336 posts
    Member since:
    May 2010

    Posted 07 Nov 2012 Link to this post

    Hello Eric,

    Also, there is a property on the MasterTemplate if i'm not mistaken to SelectLastAddedRow, or something very similar.

    Best Regards,
    Emanuel Varga
    Winforms MVP
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top