ComponentOne True DBGrid for WinForms
True DBGrid for WinForms Task-Based Help / Adding a New Row to C1TrueDBGrid / Selecting a Row
In This Topic
    Selecting a Row
    In This Topic

    Highlighting a row does not select the row. In order for the row to be selected, it must be added to the SelectedRowCollection. This can be done using the Add method.

    Add the following code to the Click event of the Select button:

    To write code in Visual Basic

    Visual Basic
    Copy Code
    Me.C1TrueDBGrid1.SelectedRows.Add(Me.C1TrueDBGrid1.Bookmark)
    

    To write code in C#

    C#
    Copy Code
    this.c1TrueDBGrid1.SelectedRows.Add(this.c1TrueDBGrid1.Bookmark);
    

    What You've Accomplished

    Using this example, the current row is selected:


    See Tutorial 5: Selecting Multiple Rows Using Bookmarks for an example of the Add method being used.