Editing Database Data in the Grid Viewer
You can use the Grid Viewer in GraphWorX to edit database data via a writable Data Source. The available operations depend on which data modification commands have been enabled for the Data Source. For more information, refer to Create writable Data Source.
NOTE: This procedure uses the SQL Server database, RollerChainManufacturing, and the PartsDetails_Daily Data Source described in Create writable Data Source, as an example.
To display data in the Grid Viewer:
-
Follow the steps in Display database data in the Grid Viewer to add a Grid viewer, and configure it to display the data of your writable Data Source.
NOTE: To follow the example, use the PartsDetails_Daily Data Source.
-
Click Runtime in the upper right corner of GraphWorX to start runtime mode. Data from the database populates the Grid Viewer via the configured query.
TIP: You can start GraphWorX runtime mode also by using the key combination CTRL+M.
To update a row in the Data Source:
-
Double-click the cell that contains the value to edit. The cell goes into edit mode.
-
Enter the desired value in the cell and press the Enter key to confirm your change. The Apply Changes and Discard Changes buttons in the ribbon become enabled.
NOTE: Changes are not saved to the database until Apply Changes is selected. Select Discard Changes to revert to the original value without saving your edit to the database.
-
Select Apply Changes to save your edit to the database.
To add a new row to the Data Source:
-
In the ribbon, select New Row. A new, empty, row is appended at the end of the existing data.
TIP: You can also right-click on the Grid Viewer, and select Insert New Row from the context menu.
-
Enter the desired data in the new row, and select Apply Changes to save your edits to the database.
To delete a row from the Data Source:
-
Select a cell on the row that you want to delete, and select Delete Row from the ribbon. Confirm your choice by selecting OK in the Warning dialog. The row is removed from the Data Source.
TIP: You can also select a cell in the row to delete, right-click the Grid Viewer and select Delete Selected Row from the context menu.
-
In the ribbon, select Apply Changes to delete the row from the database.