5/7/11

How to Get the Number of Rows in FlexGrid in Visual Basic

The flexgrid, created by ComponentOne, is a more robust grid component than the DataGridView available in Visual Basic by default. The two grid components are similar, but the flexgrid component provides more options and is more user-friendly.
    • 1

      Create a new project in Visual Basic based on the Windows Forms Application.

    • 2

      Drop a flexgrid and select the form. Name the flexgrid, "fgTest" and the button, "btnRows".

    • 3

      Set the property of the flexgrid to allow the user to enter data into the grid.

    • 4

      Double click the button and add the following code to the button event:

      MessageBox(fgTest.Rows.Count.ToString)

    • 5

      Run the program and enter some rows into the grid.

    • 6

      Click the button and a message box should appear with the number of rows in the grid. Remember the header row will count as one.

  • No comments: