Home Forums WinForms controls Xceed Grid for WinForms How to select a row(s) in code

Viewing 1 post (of 1 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #17822 |

    To select one or more rows in code, you can add (or remove) rows from grid’s SelectedRows property. Any row can be selected and added to the grid’s collection of SelectedRows as long as its CanBeSelected property is set to true. Keep in mind that the current row is not the same thing as the selected row and that the current row might not be part of the grid’s selected rows.

    VB.NET

    GridControl1.SelectedRows.Add( GridControl1.DataRows( 0 ) )

    Dim row As New TextRow( “This is my text row” )

    row.CanBeSelected = True

    GridControl1.FixedFooterRows.Add( row )
    GridControl1.SelectedRows.Add( row )

    C#

    gridControl1.SelectedRows.Add( gridControl1.DataRows[ 0 ] );

    TextRow row = new TextRow( “This is my text row” );

    row.CanBeSelected = true;

    gridControl1.FixedFooterRows.Add( row );
    gridControl1.SelectedRows.Add( row );

     

    Imported from legacy forums. Posted by Xceed admin (had 1728 views)

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.